Module: EaselHelpers::Helpers::LinkHelper

Included in:
EaselHelpers::Helpers
Defined in:
lib/easel_helpers/helpers/link_helper.rb

Instance Method Summary collapse

Instance Method Details



5
6
7
8
9
10
# File 'lib/easel_helpers/helpers/link_helper.rb', line 5

def link_button(*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


12
13
14
15
16
17
# File 'lib/easel_helpers/helpers/link_helper.rb', line 12

def link_to_email(email_address, *args)
  options = args.extract_options!
  link = args.first.is_a?(String) ? h(args.first) : email_address
  return link if email_address.blank?
  link_to link, "mailto:#{email_address}", options
end