I am trying to have the user select a drop down, which will then
update a page param, and then have a link on the page use that param.
My problem is that when the user chooses the drop down, the param for
the page is not being updated and the link is not passing the
category_type param.
Error from the development.log
NoMethodError (You have a nil object when you didn''t expect it!
The error occurred while evaluating nil.value=):
View:
<select id="category_type" name="category_type">
<option value="Type1">Type 1</option>
<option value="Type2">Type 2</option>
<option value="Type3">Type 3</option>
</select>
<%= observe_field ''category_type'', :url => {:controller
=>
''categories'', :action =>
''update_category_type''}, :with =>
"''categoryType='' + value" %>
<%= link_to ''Select'', :controller =>
''categories'', :action =>
''choose_category'', :id => category, :category_type =>
params[:category_type_link] %>
Controller:
def update_category_type
render :update do |page|
params[:category_type_link].value = "yikes"
end
end
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---