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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:53:26+00:00 2026-06-04T09:53:26+00:00

I have a working twitter bootstrap install and simple form generates the following: <form

  • 0

I have a working twitter bootstrap install and simple form generates the following:

<form accept-charset="UTF-8" action="/find_map" class="simple_form form-inline" id="new_location" method="post" novalidate="novalidate"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="p5CSoidWaoGMfHY0/3ElWi0XJVg6Cqi9GqWRNlJLBQg=" /></div>
        <div class="control-group string required"><div class="controls"><input class="string required" id="location_address" name="location[address]" placeholder="Address" size="50" type="text" /></div></div><input class="btn" name="commit" type="submit" value="Find!" />
</form>

Somehow the “Find!” button won’t appear on the same line as the search box. Any ideas?

Thanks!

UPDATE:

Sorry I should have mentioned that all the markup is generated by simple_form based on the following:

<%= simple_form_for @location, :url => find_map_path, :html => { :class => 'form-inline' } do |f| %>

        <%= f.input :address, :label => false, :placeholder => "Address" %>
        <%= f.submit "Find!", :class => 'btn' %>

<% end %>

So, really, there seems to be an issue with the generated markup, even though I have run the bootstrap install for simple_form, etc.

enter image description here

The above image shows a straight html form

<form class="form-inline">
  <input type="text" class="input-small" placeholder="Email">
  <button type="submit" class="btn">Sign in</button>
</form>

…above the one generated by simple_form.

  • 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-04T09:53:27+00:00Added an answer on June 4, 2026 at 9:53 am

    I think there are a couple issues here. One is the formatting, and the way simple_form adds a <div> around the input field. @Ron’s suggestion of using input_field works for me with simple_form 2.0.1. My example is searching for name in a Contacts table. The following makes the text box and button appear side by side:

    <%= simple_form_for :contact, :method => 'get', 
        :html => { :class => 'form-search' } do |f| %>
      <%= f.input_field :search, :placeholder => "Name", 
          :class => "input-medium search-query" %>
      <%= f.submit "Find!", :class => "btn" %>
    <% end %>
    

    The other issue is that it seems simple_form usually assumes you want to work with model and field names. The example above uses a :symbol instead of a @model as the first argument as suggested here. But that still generates an input field named contact[search] so you’d have to tell your controller how to deal with that.

    I think in this case it may be simpler to not use simple_form and instead use something like the form near the beginning of Ryan Bates’ Railscast #240, Search, Sort, Paginate with AJAX:

    <%= form_tag contacts_path, :method => 'get', :class => "form-search" do %>
      <%= text_field_tag :search, nil, :placeholder => "Name", 
          :class => "input-medium search-query" %>
      <%= submit_tag "Find!", :name => nil, :class => "btn" %>
    <% end %>
    

    Now the field is just named “search” and I can consume it in my controller’s #index method something like this:

    @contacts = @contacts.search(params[:search])
    

    assuming I have this in my model:

    def self.search(search)
      if search
        where('lower(name) LIKE ?', "%#{search.downcase}%")
      else
        scoped
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone have a working example of OAuth authentication for twitter with Android? I
I am working on windows. I have built a twitter application using the twitter
I have started working on a simple XML pull-parser, and as I've just defuzzed
I am working with a java Twitter app (using Twitter4J api). I have created
I'm working with twitter bootstrap 2.0.1 I'm trying to change the color of the
Is there any known method to have a date input working while using Twitter
I am working on a Rails 3.2.1 application with the twitter-bootstrap-rails gem. When in
I've been working on a web application using Bootstrap, and have come across odd
I am attempting to build a simple content management system using Twitter's Bootstrap for
hi i am working with Twitter, i got problem with images, i have tweet

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.