How do I add a class to a form in ruby on rails without setting / overriding the existing default helper class?
form-for, forms, ruby-on-rails, ruby-on-rails-3
Solution
I ran into exactly the same issue. Eventually, I came up with this solution
form_for @foo, :html => {:class => "form-horizontal #{controller.action_name}_model_name"}
It might be a little too late for this to be of much use to you, but maybe someone else will find it useful.
Problem
Adding a class for `form_for` through the `html: {class: "form-horizontal"}` option overrides the default `new_model` or `edit_model` class. How do I add my class while keeping the existing form_helper class? I want: `<form class="edit_model form-horizontal">` or `<form class="new_model form-horizontal">` Instead of: `<form class="form-horizontal">`