# Form\_for with partial using do |@f|

**URL:** <https://www.ruby-forum.com/t/form-for-with-partial-using-do-f/154603>\
**Category:** Rails\
**Created:** [December 2, 2008, 3:03am UTC](https://www.ruby-forum.com/t/form-for-with-partial-using-do-f/154603 "2008-12-02T03:03:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![indigoi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/b3f665/32.png) [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Post date:** [December 2, 2008, 3:03am UTC](https://www.ruby-forum.com/t/form-for-with-partial-using-do-f/154603/1 "2008-12-02T03:03:39Z")

</div>

Is it possible to pass this FormBuilder object to a controller and then  
back to a partial?

I have a form rendering a partial that i would like to update with a  
call to my controller based on user selectable parameters, but when the  
AJAX comes back, i get this error message because i cannot pass a form  
builder object between the controller and the view:

“undefined method `text\_area’ for  
“#ActionView::Helpers::FormBuilder:0x12c4038”:String”

My View looks like this:

\<% form\_for @phrase, :action =\> ‘foo’ do |@f| -%\>

```
     <%= select_tag(:language,

```

options\_for\_select([“Chinese”,“English”],  
:onchange=\> remote\_function(:with =\>  
“‘language=’+this.value”,  
:update =\> ‘slang\_form\_partial’,  
:url =\> {:action =\> :something, :form =\> @f}  
)) %\>

```
 <%= render :partial => 'forms/slang_form_partial'%>

```

\<%= @f.submit %\>

In my controller i have something that looks like this:

def something  
@default\_language = params[:language]  
@f = params[:form]  
render :partial =\> ‘forms/slang\_form\_partial’  
end

Is it possible to pass this FormBuilder object to a controller and then  
back to a partial? Rails 2.1.0 and Ruby 1.8.6.

---

<div class="post-metadata">

**Author:** ![indigoi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/b3f665/32.png) [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Post date:** [December 2, 2008, 10:54am UTC](https://www.ruby-forum.com/t/form-for-with-partial-using-do-f/154603/2 "2008-12-02T10:54:39Z")

</div>

On 2 Dec 2008, at 02:03, Richard S. wrote:

> Is it possible to pass this FormBuilder object to a controller and  
> then  
> back to a partial?

What you are doing can’t work. You can’t pass arbitrary ruby objects  
as params to a url.

Fred
