0
votes

This is my form code.

<%= simple_form_for @user do |f|%>
  <%= f.input :name %>
  <%= f.button :submit %>
<% end %>

And this is the error I get :

compile error /home/shreyas/apps/vaccidate/app/views/users/_form.html.erb:1: syntax error, unexpected ')' ... simple_form_for @user do |f|).to_s); @output_buffer.concat ^ /home/shreyas/apps/vaccidate/app/views/users/_form.html.erb:9: syntax error, unexpected kENSURE, expecting ')' /home/shreyas/apps/vaccidate/app/views/users/_form.html.erb:11: syntax error, unexpected kEND, expecting ')'

What am i supposed to do ? Thanks !

1
Hi What is "simple_form_for"? Maybe it should be "form_for"? - Bohdan
simple_form is a gem for creating forms. Similar to formtastic, but lightweight compared to formtastic. - Shreyas

1 Answers

0
votes

Your form tag should be this:

<% simple_form_for @user do |f|%>
  <%= f.input :name %>
  <%= f.button :submit %>
<% end %>

Note on the first line how I am using <%, not <%=. In Rails 3 for this plugin it will probably change to <%=, but it appears you're not using that version. The reason you're getting that error is because it's trying to output the block before it is complete.