gpt4 book ai didi

html - Simple_form 如何使接受条款复选框内联

转载 作者:太空狗 更新时间:2023-10-29 13:05:30 27 4
gpt4 key购买 nike

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

它最终看起来像这样

enter image description here

将它们排在同一条线上的最佳方式是什么。

最佳答案

这里有一个相当简单的方法:

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

关于html - Simple_form 如何使接受条款复选框内联,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13053863/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com