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...
syntax error, unexpected keyword_do_block, expecting keyword_end
If I delete the html: ... the form works (but looks shitty).
This one works (for some reason):
<%= form_for @post, html: {class: 'form-horizontal'} do |f| %>
It is probably easy to fix, but since I am new to programming - I just dont get it ;)
Thanks in advance!