Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8834769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:06:09+00:00 2026-06-14T09:06:09+00:00

I am trying to use Bootstrap forms in Rails. But after inspecting the _form

  • 0

I am trying to use Bootstrap forms in Rails. But after inspecting the _form partial created by my post scaffold, I’m not quite sure how I can edit the variables with regular input methods.

For example, this is the built-in form code:

<%= form_for(@post) do |f| %>

<div class="field">
 <%= f.label :name %><br />
 <%= f.text_field :name %>
</div>
<div class="field">
 <%= f.label :content %><br />
 <%= f.text_area :content %>
</div>
 <div class="actions">
 <%= f.submit %>
</div>

<% end %>

I want to use the form code below:

<form>
<fieldset>
<legend>Start posting</legend>
<label>Name</label>
 <input class="span10" type="text" placeholder="Name: ">
<label>Content</label>
 <input class="span10" type="text" placeholder="Content: ">
<textarea rows="10"></textarea>
<button type="submit" class="btn">Submit</button>
</fieldset>
</form>

Question: How do I use Bootstrap version of form code?

I tried something like..

<input class="span10" type="text" name="@post.name" placeholder="Type in name: ">
<button type="submit" class="btn">Submit</button>

But it doesn’t seem to work. I thought the Bootstrap submit button is not pointing at the right direction, so I tried the following as well:

<input class="span10" type="text" name="@post.name" placeholder="Type in name: ">
<%= form_for(@post) do |f| %>
 <%= f.submit %>
<% end %>

Could someone please help me with this? I appreciate your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:06:10+00:00Added an answer on June 14, 2026 at 9:06 am

    Instead of doing it manually, you should add twitter-bootstrap-rails gem to your app. Se here for instructions and documentation: twitter-bootstrap-rails gem

    That will do the trick!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use Twitter Bootstrap's pill navigation, but it's not working properly. I
I'm trying to use the rottentomatoes movie API with twitter's bootstrap typeahead plugin but
I'm trying to use bootstrap with the jquery validation plugin but when I try
I'm trying to use a system like bootstrap, but using .data() method to attach
I'm trying to use datepicker with twitter bootstrap with the following code but while
I'm trying to use Twitters bootstrap dropdown, but when I click on the dropdown
I am trying to use Twitter Bootstrap tabbable and Bootstrap popovers in a same
I am trying to use Twitter Bootstrap for GWT and get the same nice
I'm trying to use twitter bootstrap to create Facebook like tooltip layout. I would
I have recently started to use Twitter Bootstrap and trying to understand how it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.