Guest User

Untitled

a guest
Nov 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. module ApplicationHelper
  2. def bootstrap_icon_label(label, icon, white)
  3. white = ' icon-white' if white else ''
  4. "<i class=\"icon-#{icon}#{white}\"></i> #{label}".html_safe
  5. end
  6. end
  7.  
  8. # Let's you do things like this:
  9.  
  10. # <%= link_to bootstrap_icon_label('New Program', 'plus', true), new_program_path, class: "btn btn-primary" %>
  11.  
  12. # To yield a bootstrap button with a little plus icon in it. YAY!
Add Comment
Please, Sign In to add comment