views:

42

answers:

1

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 !

A: 

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.

Ryan Bigg
Looks like it now detects simple_form. But now I get this. You have a nil object when you didn't expect it!You might have expected an instance of Array.The error occurred while evaluating nil.+
Shreyas Satish