1

I'm trying to apply the bootstrap class "form-horizontal center" to my rails form_for helper as follows:

<%= form_for(@customer), :html => {:class => "form-horizontal center"} do |f| %>

I am getting a syntax error.

I have looked at this with no luck: How to add a class to the form_for helper in a Rails 4 app?

Any ideas?

Community
  • 1
  • 1
Dustin James
  • 575
  • 9
  • 21

1 Answers1

1
<%= form_for @customer, :html => {:class => "form-horizontal center"} do |f| %>

Remove brackets from @customer or move closing bracket before do:

<%= form_for(@customer, :html => {:class => "form-horizontal center"}) do |f| %>
Peter Tretyakov
  • 3,380
  • 6
  • 38
  • 54