Ruby on rails 如何嵌入带有链接到文本字段的实例方法?

Ruby on rails 如何嵌入带有链接到文本字段的实例方法?,ruby-on-rails,ruby,Ruby On Rails,Ruby,再培训局: @student.count#-->4 #-->全部展示 我想展示一下 全部显示(3) 我试过了 或 但所有这些都不起作用使用插值 @student.count #--> 4 <li><%= link_to "Show All", 'all' %></li>#-->Show all <li><%= link_to "Show All(" + @students.count.to_s + ")

再培训局:

@student.count#-->4
  • #-->全部展示
    我想展示一下

    全部显示(3)

    我试过了

  • 但所有这些都不起作用

    使用插值

    @student.count  #--> 4 
    
      <li><%= link_to "Show All",   'all'   %></li>#-->Show all
    
    <li><%= link_to "Show All(" + @students.count.to_s + ")" , 'all' %></li>
    
    这很有效

    "Show All" + @students.count
    
    使用插值

    @student.count  #--> 4 
    
      <li><%= link_to "Show All",   'all'   %></li>#-->Show all
    
    <li><%= link_to "Show All(" + @students.count.to_s + ")" , 'all' %></li>
    
    这很有效

    "Show All" + @students.count
    
    试一试

  • 试试看