Hi,
I wanted to create some static pages using rails and used
rails g controller Staticpages main movie song book
Which has created a controller file "static_pages_controller.erb" and
view files under /views/static_pages/main.html.erb etc
I have created a form using form_for on my main page which has a drop
down menu for selecting one of "movie, song, book" and a submit button
using
<%= form_for :mode do |f| %>
<div class="field">
<%= f.label :mode %><br />
<%= f.select :mode, ['Please select one', 'Movie', 'Book',
'Song'] %>
</div>
<div class="actions">
<%= f.submit "Submit" %>
</div>
<% end %>
My controller file looks like this
class StaticPagesController < ApplicationController
def main
end
def movie
end
...
end
A click on submit on my main page generates 'No route matches POST
"/static_pages/main" . Do i have to create a func for post? If so since
the static pages class is same for the remaining movie,book, song how do
i handle submits from other pages?
Also how do i retrieve the values of form_for in the controller?
--
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 [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.