Module: ExceptionHandler::ApplicationHelper

Defined in:
app/helpers/exception_handler/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#social(*services) ⇒ Object

Social



10
11
12
13
14
15
16
17
18
19
20
# File 'app/helpers/exception_handler/application_helper.rb', line 10

def social *services
	output = []
	# options = args.extract_options! http://simonecarletti.com/blog/2009/09/inside-ruby-on-rails-extract_options-from-arrays/ - args for arrays

	services = ExceptionHandler.config[:social] unless services.any?
	services.except(:url).each do |service,username| #-> except http://stackoverflow.com/a/11105831/1143732
  			output.push link_to(image_tag("exception_handler/connect/#{service}.png", title: "Find us on " + service.to_s.titleize), link(service), target: :blank, class: service.to_s)
  		end

  		output.join("").html_safe #-> ruby returns last line
end