Form_for, partials, and link_to_remote


#1

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?


#2

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/


#3

Thanks.