Forum: Ruby on Rails form_for, partials, and link_to_remote

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Will C. (Guest)
on 2009-03-31 21:49
I'm using Rails 2.3.2 with a form to edit a Page object:

<% form_for([:admin, @page], :class => "form") do |f| %>
#...
<% end %>

In that form I'm also using fields_for/nested models. I want the ability
in the form to have a link_to_remote that calls a partial that has the
fields_for related to the nested model. I can't use a link_to_function,
because I need the ability to add an unlimited number of the partial and
I end up getting a stack level too deep error.

So my question is this: is it possible to pass the formbuilder object
(f) to the controller via a link_to_remote so when the ajax call
displays the partial, it can pass the formbuilder object to the partial?
Starr H. (Guest)
on 2009-03-31 23:17
(Received via mailing list)
On Tue, 31 Mar 2009 19:49:33 +0200
Will C. <removed_email_address@domain.invalid> wrote:

> So my question is this: is it possible to pass the formbuilder object
> (f) to the controller via a link_to_remote so when the ajax call
> displays the partial, it can pass the formbuilder object to the partial?

Nope. But you can always just use the older "text_field_tag" type
methods in your partial.

SH.
--
Starr H.
Check out my Helpdesk RailsKit: http://railskits.com/helpdesk/
Will C. (Guest)
on 2009-04-01 22:31
Thanks.
This topic is locked and can not be replied to.