Sunday, 11 August 2013

Rails: Error when adding class to a form

Rails: Error when adding class to a form

I am running into an error I cant figure out, because it works with
another form. I am trying to add a class to a form - it looks like this:
<%= form_for([@post, @post.comments.build]), html: {class:
'form-horizontal'} do |f| %>
but this throws an error:
syntax error, unexpected tLABEL ..., @post.comments.build]), html: {class:
'form-horizontal'} d...
If I delete the html: ... the form works (but looks shitty).
It is probably easy to fix, but since I am new to programming - I just
dont get it ;)
Thanks in advance!

No comments:

Post a Comment