Best way to use Twitter Bootstrap Icons as Links in Ruby on Rails 3?

后端 未结 5 1753
傲寒
傲寒 2020-12-30 16:04

What\'s the best way to use an icon provided by Twitter Bootstrap as a link in Rails 3?

Currently, I am using it like the pasted snippet, but the icon doesn\'t displ

5条回答
  •  佛祖请我去吃肉
    2020-12-30 16:31

    Using link_to with icon bootstrap

    <%= link_to edit_idea_path(idea), class: 'btn btn-default' do %>
        
        Edit
      <% end %>
    
    <%= link_to new_idea_path, class: 'btn btn-primary btn-lg' do %>
      
      New Idea
    <% end %>
    
      <%= link_to idea, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' do %>
        
        Destroy
      <% end %>
    

    http://railsgirls.co.il/en/guides/design/list-page/icons.html

提交回复
热议问题