Simple_form how to make accept terms checkbox inline

后端 未结 3 802
无人共我
无人共我 2020-12-31 13:32

<%= f.input :terms, :as => :boolean, :label => false, :boolean_style => :inline %> Accept <%= link_to \"Terms of use\", terms_path,:remot

3条回答
  •  孤城傲影
    2020-12-31 14:22

    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%>
    

    the-non-styled-output

提交回复
热议问题