0

I have a view with a form_for and it has a submit button. I would like the submit button to be styled using twitter bootstrap rails gem (which I have successfully installed into the rails project.) However the the button isn't being styled for whatever reason, and the text in the button appears different from I specified in the argument.

The source for the view, new.html.erb

<div id="sign_up">
<h1>Sign Up</h1>

<%= form_for @user do |f| %>
  <% if @user.errors.any? %>
    <div class="error_messages">
      <h2>Form is invalid</h2>
      <ul>
        <% @user.errors.full_messages.each do |message| %>
          <li><%= message %></li>
        <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
     <!-- <%= f.label :email %> --><br />
    <%= f.text_field :email, :class => 'input-xlarge', placeholder: 'email' %>
  </div>
  <div class="field">
     <!-- <%= f.label :password %>--><br />
    <%= f.password_field :password, :class => 'input-xlarge', placeholder: 'Password' %>
  </div>
  <div class="field">
     <!-- <%= f.label :password_confirmation %>--><br />
    <%= f.password_field :password_confirmation, :class => 'input-xlarge', placeholder: 'Password confirm' %>
  </div>
  <div class="actions"><%= f.submit nil, class: 'btn btn-large' "Sign Up" %></div>
<% end %>
</div>

Right now the form looks like the following,

simple form

1 Answer 1

4

<%= f.submit nil, class: 'btn btn-large' "Sign Up" %>

Should be:

<%= f.submit "Sign Up", class: 'btn btn-large' %>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.