I found something pretty weird and can't explain it:
Following form with a submit button
<!-- Nested form -->
<%= f.fields_for :area_attributes do |builder| %>
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel_heading">
<%= builder.label :name, "Name of the attribute" %>
<%= builder.text_area :name %>
</div>
<div class="panel-body">
<%= builder.label :value, "Value of the attribute" %>
<%= builder.text_area :value %>
<%= builder.check_box :_destroy %>
<%= builder.label :_destroy, "Remove Question" %>
</div>
</div>
</div>
<% end %>
</section>
<div class="actions">
<%= f.submit %>
</div>
Now this worked great, then i switched to bootstrap and wanted to change the class of the submit div to something else.
<div class="submit">
<%= f.submit %>
</div>
And now the button didn't trigger anything anymore?! No request was sent, nothing happened (and I don't know where the .actions is coming from, I took it from a tutorial). Then I changed it to
<div class="submit">
<%= f.submit() %>
</div>
And now its working again? Even the docs list it without parentheses, I'm new to ruby but as far as I know the parentheses is optional, right? Why is it needed here??
UPDATE Feb. 5 Okay this has nothing to do with parentheses. I tracked it down and it seems that the button is only working when refreshing the page and NOT when I navigate to the page ordinarily. I had a very similar problem and I could solve it using the jquery-turbolinks gem As described here
Im working in the same project, the gem is installed, what is going on here? I checked the HTML output and there is no difference between the working version and the not working version:
<input class="positive-button" name="commit" type="submit" value="Create Area">
Greetings