title: Ruby on Rails - adding CSS to text_field
body: <p>I created a form in Rails and when I add a CSS class to a text_field the form will not submit. </p>
  
  <p>I am still new to rails so any help would be much appreciated. </p>
  
  <p>This is my form: </p>
  
  <pre><code>&lt;% @page_title = "Contact" %&gt;
      &lt;hr&gt;
      &lt;div class="col-lg-12"&gt;
                  &lt;h1 class="page-header"&gt;
                      BK Legal Courier Corp &lt;br /&gt;Call BK @ &lt;span style="color:#47B224"&gt;613-286-8265&lt;/span&gt;
                  &lt;/h1&gt;
              &lt;/div&gt;
  
  &lt;hr&gt;
  &lt;div class="container"&gt;
    &lt;h2&gt;Contact Us&lt;/h2&gt;
     &lt;%= form_for :fc, :url =&gt; {:action =&gt; 'create'} do |f| %&gt;
      &lt;div class="form-group"&gt;
        &lt;%= f.label :first_name %&gt;
        &lt;%= f.text_field (:first_name, :class =&gt; 'form-control')%&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
        &lt;%= f.label :last_name %&gt;
       &lt;%= f.text_field (:last_name, :class =&gt; 'form-control') %&gt;
      &lt;/div&gt;
       &lt;div class="form-group"&gt;
        &lt;%= f.label :email %&gt;
        &lt;%= f.text_field (:email, :class =&gt; 'form-control') %&gt;
      &lt;/div&gt;
       &lt;div class="form-group"&gt;
    &lt;%= f.label :comment %&gt;
   &lt;%= f.text_area (:comment, :class =&gt; 'form-control') %&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
    &lt;%= f.label :referral %&gt;
          &lt;%= f.select (:referral, [['Friends', 1], ['News', 2], ['Online', 3], ['Other', 4]], :class =&gt; 'form-control')%&gt;
  &lt;/div&gt;
   &lt;%= submit_tag ("Submit") %&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  
  &lt;% end %&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>The problem is that my form will only submit without the :class => "form-control" in it. I must have brackets around each of the form field variables. </p>
  
  <p>This is my routes.rb file:</p>
  
  <pre><code>    Rails.application.routes.draw do
    root "home#index"
  
  
    match ':controller(/:action(/:id))', :via =&gt; [:get, :post]
  
      end
  </code></pre>
  
  <p>This is my controller:</p>
  
  <pre><code>    class HomeController &lt; ApplicationController
       def home
          render("home/index")
       end
        def new
  @fc = FeedbackCustomer.new
    end
    def create
       # Instantiate a new object using form parameters
      @fc = FeedbackCustomer.new(feedbackcustomer_params)
  if @fc.save
      redirect_to(:action =&gt; "home")
  end
    end
  
    def application
  
    end
  
  private
  
  def feedbackcustomer_params
  params.require(:fc).permit(:first_name, :last_name, 
      :email, :comment, :referral)
      end
  end
  </code></pre>
  
  <p>Any help would be much appreciated. Thanks!</p>