Hi all
Apologies first of all if this it the third time of seeing this, I posted
previously but didn't see it on the googlegroup archive or current
discussions.
Ive got a form that's based on a model that I need to put a drop down
box and additional text field to build the description for the item.
heres some quick code
View
<%= form_for (@shape) do |f| %>
<%= f.text_field :description %>
<%= select_tag "shape_name", "<option>round</option><option>square</
option><option>triangular</option>" %>
<%= text_field_tag "shape_code" =>
Controller
@shape.new
@shape.description = params[:description]
@shape.shape = "#{params[:shape_name]} #{params[:shape_code]}"
@shape.save
What happens is I get the shape.shape set right (to the name from the
select box and the code from the text field) but description is always
empty,
Heres whats in the params when I do a raise shape.to_yaml to debug it.
{"shape_name"=>"triangular",
"shape_code"=>"shape code is here",
"order"=>{"description"=>"this is a description"}}
Can someone point out how I should be accessing the params so I can
set the description of the shape?
Many thanks
Jonathan Gill
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---