【问题标题】:Ruby on Rails Glyphicons Button Rooting PagesRuby on Rails Glyphicons 按钮 Rooting 页面
【发布时间】:2016-06-16 20:08:25
【问题描述】:

例如,我有一个新的页面/新路径。如何在我的 Button_Code 中链接路径?!有人有想法吗?

我将点击此按钮,然后我将转到我的程序中的“新”页面。

感谢帮助

<i> <div class="center jumbotron">
<div>
 <center-right>
  <button  type="button" class="btn btn-info">

    <span class="glyphicon glyphicon-search"></span> Mitnehmgelegenheit inserien!

  </button>
</center-right>

  <center-left>
  <button type="button" class="btn btn-info">

    <span class="glyphicon glyphicon-search"></span> Mitnehmgelegenheit suchen!
  </button>
</centerleft>

<i>

【问题讨论】:

    标签: ruby-on-rails glyphicons


    【解决方案1】:

    我会使用 button_to 助手

    <%= button_to new_path, {class: "btn btn-info"} do %>
      <span class="glyphicon glyphicon-search"></span> Mitnehmgelegenheit inserien!
    <% end %>
    

    【讨论】:

      【解决方案2】:

      据我所知,您希望有一个在单击时将重定向到新页面的按钮。您可以使用 link_to 标记执行此操作,并按以下方式向其添加引导按钮类。

      <%= link_to '+ New ', new_path, class: 'btn btn-info' %>
      

      【讨论】:

        猜你喜欢
        • 2013-12-13
        • 2014-11-16
        • 2016-06-20
        • 2011-04-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多