0

I am trying to create a form using Simple Form. For some reason, I can't change the class of the form. I am using the following code:

<%= simple_form_for @presentation, url: send_out_emails_path, 
    defaults: {input_html: { :class => 'form-horizontal' } } do |f| %>
    <!-- Form content here !-->
<% end %>

It is generating this html:

<form action="/sendout" class="simple_form edit_presentation" id="edit_presentation_152" method="post" novalidate="novalidate">
     <!-- Form content here !-->
</form>

Why is the class not being changed?

Philip7899
  • 4,599
  • 4
  • 55
  • 114
  • Are you saying you want the `form` element's `class` to change? It looks to me like the code you've provided may change the `input` elements' `class` of that form. – Joe Essey Apr 28 '15 at 19:22
  • 1
    The `input_html` hash key is for setting the input HTML element items. The format I've seen for setting the class to `form-horizontal` is: `simple_form_for @presentation, :html => {:class => 'form-horizontal'} do |f| ...`. – lurker Apr 28 '15 at 19:37
  • 1
    See: http://stackoverflow.com/questions/13903175/simple-form-adding-class-to-form – Joe Kennedy Apr 28 '15 at 20:03

0 Answers0