Hi all
Ive got a form thats 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”, “roundsquare</
option>triangular” %>
<%= 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”}
“shape_code”=>“342”,
“shape_number”=>“111”,
“finish1”=>“Silver”,
“commit”=>“Create”,
Can someone point out how I should be accessing the params so I can
set the description of the shape?
Many thanks
Jonathan G.