Once I replaced “form{:action => “/comments”}” with a “form_tag(‘/comments’)” in the following code:
=form_tag('/comments')
%fieldset
%input.comment_input{ :name => "comment[comment]", :size => 60, :type => "text" }
%input{ :name => "comment[activity_id]", :type => 'hidden', :value => "#{activity.id}" }
%button.post_coment_btn{ :type => "submit", :formmethod => "post"} Add Comment
I then got the following error:
syntax error, unexpected keyword_ensure, expecting $end
. . on line 18, but the file containing the above only has 17 lines. Am I using the form_tag incorrectly?
<– Update –>
Using the form_tag do as indicated by @Ben Zhang worked only I actually wanted to go to the ‘create’ action in the ‘comments’ controller:
=form_tag :action => 'create', :controller => 'comments' do
Try this one