Good morning, (Let me preface by saying I am at a beginners level). I would like to set the variable params[:question_type] which is in a view to "assembler" in order to use it in the controller... I have tried the following... <%= link_to ''New Assembler'', new_minisection_question_path(:minisection_id => session[:minisection][:id], params[:question_type]=> "assembler") %> | What I am doing does not work. My question is how do I set the params[:question_type] in the view and then access in in the controller? (I need it to be set based on the link_to button selected) Thanks DC -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mar 12, 11:52 am, Dave Castellano <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> > <%= link_to ''New Assembler'', > new_minisection_question_path(:minisection_id => > session[:minisection][:id], params[:question_type]=> "assembler") %> |That should be :question_type => "assembler" (right now you''re passing the value assembler, but with the name set to value of params[:question_type] rather than just :question_type Fred> > What I am doing does not work. > > My question is how do I set the params[:question_type] in the view and > then access in in the controller? (I need it to be set based on the > link_to button selected) > > Thanks > DC > > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung wrote in post #987077:> On Mar 12, 11:52am, Dave Castellano <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> >> <%= link_to ''New Assembler'', >> new_minisection_question_path(:minisection_id => >> session[:minisection][:id], params[:question_type]=> "assembler") %> | > > That should be :question_type => "assembler" (right now you''re passing > the value assembler, but with the name set to value of > params[:question_type] rather than just :question_type > > FredThank you!!! That did it. DC -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.