Hi fellow rubians ;)
Im trying to populate one collection_select from another and I got it
pretty much down I think:
VIEW 1 (first combobox):
<%= collection_select( :doctype, :name, @doctypes, :id, :name, options
{:prompt => "Select doctype"}) %>
<%= observe_field ''doctype[name]'', :frequency => 2,
:update => ''fieldtypes'',
:url => {:action => ''doctype_changed'',
} %>
Second combobox is about the same. Controller method:
def doctype_changed
@doctype_pages, @doctypes = paginate :doctypes
@fieldtypes = @doctypes[???????].fieldtypes
render :partial => "fieldtype", :layout => false
end
Now this works fine if i give it a number in the ??????? part and info
pops up in the second combobox just fine. Now obviously what I want to
is to pass the value of combobox 1 to this method, but I cant figure out
what this parameter is called.
In the errormessage it states I send the correct value, I just need to
know how to reference it in my doctype_changed-method:
Request
Parameters: {"1"=>""}
(etc.)
Thanks for any help :)
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---