Jonathan Agoot
2007-Aug-26 00:02 UTC
[ select_tag and options_for_select ] posting problem
Hello community! Here is the problem: I''m using select_tag and options_for_select for the 50 U.S States to be sent to the database table called "properties". But upon a new posting or editing a posting, it does not post to the database. <% form_tag :propertiy, :url => properties_url, :html => {:method => :put }%> <p>State: <%= select_tag ("state[]" , options_for_select([''AL'', ''AK'', ''AZ'', ''AR'', ''CA'', ''CO'', ''CT'', ''DE'', ''DC'', ''FL'', ''GA'', ''HI'', ''ID'', ''IL'', ''IN'', ''IA'', ''KS'', ''KY'', ''LA'', ''ME'', ''MD'', ''MA'', ''MI'', ''MN'', ''MS'', ''MO'', ''MT'', ''NE'', ''NV'', ''NH'', ''NJ'', ''NM'', ''NY'', ''NC'', ''ND'', ''OH'', ''OK'', ''OR'', ''PA'', ''RI'', ''SC'', ''SD'', ''TN'', ''TX'', ''UT'', ''VT'', ''VA'', ''WA'', ''WV'', ''WI'', ''WY''])) %> Can someone please 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 -~----------~----~----~----~------~----~------~--~---
Jon Obsideo
2007-Aug-26 00:17 UTC
Re: [ select_tag and options_for_select ] posting problem
Here is the whole "new.rhtml" so far: <h2>Create New Property</h2> <%= error_messages_for :property %> <% form_for :property, :url => property_url(@property), :html => { :method => :put } do |f| -%> <p>MLS Number: <%= f.text_field :mls_number, :size => 5 %> </p> <p>House Number: <%= f.text_field :house_number, :size => 5 %> </p> <p>Street Name: <%= f.text_field :street_name, :size => 20 %> </p> <p>City: <%= f.text_field :city, :size => 20 %> </p> <% form_tag :property, :url => properties_url, :html => {:method => :put } %> <p>State: <%= select_tag ("state[]" , options_for_select([''AL'', ''AK'', ''AZ'', ''AR'', ''CA'', ''CO'', ''CT'', ''DE'', ''DC'', ''FL'', ''GA'', ''HI'', ''ID'', ''IL'', ''IN'', ''IA'', ''KS'', ''KY'', ''LA'', ''ME'', ''MD'', ''MA'', ''MI'', ''MN'', ''MS'', ''MO'', ''MT'', ''NE'', ''NV'', ''NH'', ''NJ'', ''NM'', ''NY'', ''NC'', ''ND'', ''OH'', ''OK'', ''OR'', ''PA'', ''RI'', ''SC'', ''SD'', ''TN'', ''TX'', ''UT'', ''VT'', ''VA'', ''WA'', ''WV'', ''WI'', ''WY''])) %> <p>Listing Agent Information</p> <p>First <%= f.text_field :list_agent_first_name, :size => 15 %></p> <p>Last <%= f.text_field :list_agent_last_name, :size => 15 %> </p> <p>Listing Company: <%= f.text_field :list_office_name, :size => 15 %></p> <p>Bedrooms: <%= f.text_field :bedrooms, :size => 2 %></p> <%= submit_tag ''Save'' %> or <%= link_to ''cancel'', properties_url %> <% end -%> -- 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 -~----------~----~----~----~------~----~------~--~---