Simple_form how to make accept terms checkbox inline

css, html, ruby-on-rails, simple-form, twitter-bootstrap

Solution

Here's a rather simple way:

<%= content_for(:the_links) do %>
    Accept <%= link_to "Terms of use", terms_path,:remote => true %> 
    and <%=link_to "privacy Policy", privacy_path, :remote => true%>
<% end %>

<%= simple_form_for @user do |f| %>
  <%= f.input :email %>
  <%= f.input :password %>
  <%= f.input :terms, :as => :boolean, :label => content_for(:the_links)%> 
<% end%>

Problem

``` <p><%= f.input :terms, :as => :boolean, :label => false, :boolean_style => :inline %> Accept <%= link_to "Terms of use", terms_path,:remote => true %> and <%=link_to "privacy Policy", privacy_path, :remote => true%></p> ``` It ends up looking like this What is the best way to line them up on the same line.

Original source