Module: EaselHelpers::Helpers::LinkHelper
- Included in:
- EaselHelpers::Helpers
- Defined in:
- lib/easel_helpers/helpers/link_helper.rb
Instance Method Summary collapse
Instance Method Details
#link_button(*args, &block) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/easel_helpers/helpers/link_helper.rb', line 5 def (*args, &block) doc = Hpricot(link_to(*args, &block)) doc.at("a").inner_html = "<span>#{doc.at("a").inner_html}</span>" (doc/:a).add_class("btn") doc.to_html end |
#link_to_email(email_address, *args) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/easel_helpers/helpers/link_helper.rb', line 12 def link_to_email(email_address, *args) = args. link = args.first.is_a?(String) ? h(args.first) : email_address return link if email_address.blank? link_to link, "mailto:#{email_address}", end |