app/helpers/icon_helper.rb
# Provides a link with a fontawesome icon prepended
#
# === Parameters
#
# [body]          the text that should be linked
# [url]           the URL of the link
# [icon]          the icon that should be appended/prepended
# [html_options]  any options that should be passed to link_to
Provides a link with a fontawesome icon prepended
Parameters

[body]          the text that should be linked
[url]           the URL of the link
[icon]          the icon that should be appended/prepended
[html_options]  any options that should be passed to link_to
Provides a link with a fontawesome icon prepended Parameters [ body ] the text that should be linked [ url ] the URL of the link [ icon ] the icon that should be appended / prepended [ html_options ] any options that should be passed to link_to
def link_to_with_icon( body, url, icon, html_options = {})
    html_options[:class] ||= ""
    html_options[:class].prepend( " " ) unless html_options[:class].empty?
    html_options[:class] << ' btn--icon-after' if html_options.key?( :icon_after )
    link_text = html_options.key?( :icon_after ) ? "#{body} #{icon( icon, title: nil )}" : "#{icon( icon, title: nil )} #{body}"
    html_options.delete( :icon_after )
    link_to( link_text.html_safe, url, html_options )
  end
def link_to_with_icon ( body , url , icon , html_options = { } ) html_options [ :class ] ||= "" html_options [ :class ] . prepend ( " " ) unless html_options [ :class ] . empty? html_options [ :class ] << ' btn--icon-after' if html_options . key? ( :icon_after ) link_text = html_options . key? ( :icon_after ) ? "#{body} #{icon( icon, title: nil )}" : "#{icon( icon, title: nil )} #{body}" html_options . delete ( :icon_after ) link_to ( link_text . html_safe , url , html_options ) end
Provides a link with a fontawesome icon prepended
 Parameters
Provides a link with a fontawesome icon prepended Parameters
body
url
icon
html_options