lib/spurs/flash/helper.rb in spurs-0.0.2 vs lib/spurs/flash/helper.rb in spurs-0.0.3

- old
+ new

@@ -40,11 +40,13 @@ alert_content.concat(block_content) end content_tag(:div, alert_content.html_safe, :class => "alert alert-block #{extra_class}") end - + def logger + Rails.logger + end ## # Generate HTML for flash messages # = Examples # # spurs_flash_helper @@ -64,19 +66,19 @@ flash.each do |fl| process_flash_message(fl, message_hash) end flash.clear - Rails.logger.info("MESSAGE HASH >>#{message_hash.to_json}") + logger.debug("MESSAGE HASH >>#{message_hash.to_json}") #process the message hash now content = String.new message_hash.each do |k, v_arr| v_arr.each do |v| if v == nil - Rails.logger.warn("Flash key with no value: #{k.to_s} in flash hash #{v_arr.to_json}") + logger.warn("Flash key with no value: #{k.to_s} in flash hash #{v_arr.to_json}") else content << spurs_alert(v, :flavor => k, :builder => my_options[:builder], :title => k.to_s.singularize.tableize.to_sym.to_s.titlecase) end end end @@ -101,10 +103,10 @@ end # attempt to find the flavor in the list of known stuff if Spurs::Flash::flavors.find_index(my_options[:flavor]) == nil # didn't find it. - Rails.logger.warn("Unknown flash flavor \"#{my_options[:flavor]}\". Using a default instead") + logger.warn("Unknown flash flavor \"#{my_options[:flavor]}\". Using a default instead") my_options[:flavor] = Spurs::Flash::default_args[:default][:flavor] end if !my_options[:title_icon] \ No newline at end of file