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 8519481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:15:40+00:00 2026-06-11T06:15:40+00:00

I am still very new to programming and trying to learn with rails. I

  • 0

I am still very new to programming and trying to learn with rails. I have copied and pasted the email form from http://matharvard.ca/posts/2011/aug/22/contact-form-in-rails-3/ and I am now trying to apply twitter bootstrap styling to the form below. I have tried several different ways with no luck but I guess I lack understanding of what and why the fieldset tag exist and how to apply the various css classes to what I think are helpers. If someone could point me in the right direction that would be great (still very new to programming, design, and rails so if one could confirm that I am looking at helpers here that would be a bonus).

Thank you in advance for your help.

<%= form_for @message, :url => contact_path do |form| %>
<fieldset class="fields">
 <div class="field">
  <%= form.label :name %>
  <%= form.text_field :name %>
 </div>

 <div class="field">
  <%= form.label :email %>
  <%= form.text_field :email %>
 </div>
 <div class="field">
  <%= form.label :subject %>
  <%= form.text_field :subject %>
 </div>

 <div class="field">
  <%= form.label :venue %>
  <%= form.text_field :venue %>
 </div>

 <div class="field">
  <%= form.label :date %>
  <%= form.text_field :date %>
 </div>

 <div class="field">
  <%= form.label :time %>
  <%= form.text_field :time %>
 </div>

 <div class="field">
  <%= form.label :body %>
  <%= form.text_area :body %>
 </div>
</fieldset>

<fieldset class="actions">
  <%= form.submit "Send" %>
 </fieldset>
<% end %>
  • 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-11T06:15:41+00:00Added an answer on June 11, 2026 at 6:15 am

    This is how it should be:

    <%= form_for @message, :url => contact_path, :html => {:class => "form-horizontal"} do |form| %>
    <fieldset>
     <div class="control-group">
      <%= form.label :name, :class => "control-label" %>
      <div class="controls">
        <%= form.text_field :name %>
      </div>
     </div>
    
     <div class="control-group">
      <%= form.label :email, :class => "control-label" %>
      <div class="controls">
        <%= form.text_field :email %>
      </div>
     </div>
    
     <div class="control-group">
      <%= form.label :subject, :class => "control-label" %>
      <div class="controls">
        <%= form.text_field :subject %>
      </div>
     </div>
    
     <div class="control-group">
      <%= form.label :venue, :class => "control-label" %>
      <div class="controls">
        <%= form.text_field :venue %>
      </div>
     </div>
    
     <div class="control-group">
      <%= form.label :date, :class => "control-label" %>
      <div class="controls">
        <%= form.text_field :date %>
      </div>
     </div>
    
     <div class="control-group">
      <%= form.label :time, :class => "control-label" %>
      <div class="controls">
        <%= form.text_field :time %>
      </div>
     </div>
    
     <div class="control-group">
      <%= form.label :body, :class => "control-label" %>
      <div class="controls">
        <%= form.text_area :body %>
      </div>
     </div>
    
     <div class="control-group">
      <div class="controls">
        <%= form.submit "Send" %>
      </div>
     </div>
    
    </fieldset>
    <% end %>
    

    It’s going to be a headache adding this styles in a large Rails application with more than one form. So I recommend you to use SimpleForm gem that come with twitter bootstrap generator (read the installation guide).

    With this gem your form will be bootstrap ready as simple as this:

    <%= simple_form_for @message, :url => contact_path, :html => { :class => 'form-horizontal' } do |form| %>
      <%= form.input :name %>
      <%= form.input :email %>
      <%= form.input :subject %>
      <%= form.input :venue %>
      <%= form.input :date %>
      <%= form.input :time %>
      <%= form.button :submit %>
    <% end %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new to jquery and programming in general but I'm still trying to
Very new to web programming still and I don't really have a specific question
Still very new to programming... I have 9x1 Vectors at time t, t+1, t+2
I'm still very new at programming, and our local SSIS genius isn't here today
I'm still very new to Android, but I am trying to keep up by
EDIT: Updated with suggestions from Bill Karwin below. Still very slow. I'm trying to
I'm still very new to Object Oriented programming and am having problems with the
I'm very new to Python and multithreaded programming in general. Basically, I have a
Pretty new to C# but not new in programming in generally. I'm still trying
I'm still very new to programming and I want to write the cleanest code

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.