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.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to