Hi everyone,
I’m using RESTful routes and am trying to implement a simple comment
form. For some reason when I submit the form I get an error that it’s
trying to render the index action, instead of processing the comment and
returning me to the same page. Here’s my form_for:
<% form_for @comment do |f| %>
<%= f.text_area :body, :class => “small_textarea” %>
Post your comment
<% end %>
Here’s what I have in the HTML:
Shouldn’t it be: <form action="/comments/create"…>? It doesn’t seem to
understand that I want it to create the comment. Even when I do this:
<% form_for @comment, :url => {:controller => “comments”, :action =>
“create”} do |f| %>
It gives me the exact same URL. What am I missing here?