将输入放入标签

时间:2017-03-02 06:20:15

标签: html ruby-on-rails erb

我希望得到这样的结果:

<div>
    <label>
      <input type="checkbox">
    </label>
</div>

注意标签中的输入。 我的ERB代码现在:

<div class="form-check">
   <%= f.label :remember_me, class: "form-check-label" %>
   <%= f.check_box :remember_me, class: "form-check-input" %>
</div>

您如何更改此内容以获取标签中的输入。

2 个答案:

答案 0 :(得分:2)

这样做。您可以使用 Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols <WebService(Namespace:="http://tempuri.org/")> _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Public Class WebService Inherits System.Web.Services.WebService <WebMethod()> _ Public Function HelloWorld() As String Return "Hello World" End Function <WebMethod()> _ Public Function soumya(ByVal f_name As String) As String Dim a As String = f_name If a = "one" Then a = "hello" Return a ElseIf a = "two" Then a = "may" Return a Else a = "do" Return a End If End Function End Class

嵌套输入
do

答案 1 :(得分:0)

您可以为标签指定一个块,如下所示:

<div class="form-check">
  <%= f.label :remember_me, class: "form-check-label" %>
      <%= f.check_box :remember_me, class: "form-check-input" %>
  <% end %>
</div>

有关详细信息,请参阅this stack overflow question