# Form\_for, partials, and link\_to\_remote

**URL:** <https://www.ruby-forum.com/t/form-for-partials-and-link-to-remote/164387>\
**Category:** Rails\
**Created:** [March 31, 2009, 7:49pm UTC](https://www.ruby-forum.com/t/form-for-partials-and-link-to-remote/164387 "2009-03-31T19:49:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![willclarkdesigns](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/85f322/32.png) [@willclarkdesigns](https://www.ruby-forum.com/u/willclarkdesigns)\
**Post date:** [March 31, 2009, 7:49pm UTC](https://www.ruby-forum.com/t/form-for-partials-and-link-to-remote/164387/1 "2009-03-31T19:49:33Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![willclarkdesigns](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/85f322/32.png) [@willclarkdesigns](https://www.ruby-forum.com/u/willclarkdesigns)\
**Post date:** [March 31, 2009, 9:17pm UTC](https://www.ruby-forum.com/t/form-for-partials-and-link-to-remote/164387/2 "2009-03-31T21:17:42Z")

</div>

On Tue, 31 Mar 2009 19:49:33 +0200  
Will C. [removed\_email\_address@domain.invalid](mailto: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/](http://railskits.com/helpdesk/)

---

<div class="post-metadata">

**Author:** ![willclarkdesigns](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/85f322/32.png) [@willclarkdesigns](https://www.ruby-forum.com/u/willclarkdesigns)\
**Post date:** [April 1, 2009, 8:31pm UTC](https://www.ruby-forum.com/t/form-for-partials-and-link-to-remote/164387/3 "2009-04-01T20:31:35Z")

</div>

Thanks.
