Permalink
Browse files

Revert "make compatible with rails ~> 3.0"

This reverts commit 9eb05f0.

Reason: no more support to 3.0, sorry @nashby :)
  • Loading branch information...
1 parent c2a5c02 commit 7348ce145246cb5f20ca927fec6f617609032b87 @carlosantoniodasilva carlosantoniodasilva committed May 8, 2013
Showing with 3 additions and 19 deletions.
  1. +1 −16 lib/mail_form/notifier.rb
  2. +2 −3 lib/mail_form/views/mail_form/contact.erb
View
@@ -1,20 +1,5 @@
module MailForm
class Notifier < ActionMailer::Base
- # since ActionMailer 3.0 has own simple_format method
- # but we need one from the ActionPack
- # https://github.com/rails/rails/commit/fb34f8577c47d958ca32b7ab585c1904e1a776b1
- helper do
- def simple_format(text, html_options={}, options={})
- @text_helper ||= Class.new do
- include ActionView::Helpers::TextHelper
- include ActionView::Helpers::TagHelper
- include ActionView::Helpers::SanitizeHelper
- end.new
-
- @text_helper.simple_format(text, html_options, options)
- end
- end
-
self.mailer_name = "mail_form"
append_view_path File.expand_path('../views', __FILE__)
@@ -37,4 +22,4 @@ def contact(resource)
mail(headers)
end
end
-end
+end
@@ -22,9 +22,8 @@
value = @resource.request.send(attribute)
value = if value.is_a?(Hash) && !value.empty?
- content_tag(:ul, :style => "list-style:none;") do
- value.to_a.map{ |k,v| content_tag(:li, h("#{k}: #{v.inspect}")) }.reduce{ |list, li| list << li << '\n'.html_safe }
- end
+ list = value.to_a.map{ |k,v| content_tag(:li, h("#{k}: #{v.inspect}")) }.join("\n")
+ content_tag(:ul, raw(list), :style => "list-style:none;")
elsif value.is_a?(String)
value
else

1 comment on commit 7348ce1

Collaborator

nashby commented on 7348ce1 May 8, 2013

yay!

Please sign in to comment.