Skip to content

Commit

Permalink
Revert "make compatible with rails ~> 3.0"
Browse files Browse the repository at this point in the history
This reverts commit 9eb05f0.

Reason: no more support to 3.0, sorry @nashby :)
  • Loading branch information
carlosantoniodasilva committed May 8, 2013
1 parent c2a5c02 commit 7348ce1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
17 changes: 1 addition & 16 deletions lib/mail_form/notifier.rb
Original file line number Diff line number Diff line change
@@ -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__)

Expand All @@ -37,4 +22,4 @@ def contact(resource)
mail(headers)
end
end
end
end
5 changes: 2 additions & 3 deletions lib/mail_form/views/mail_form/contact.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

1 comment on commit 7348ce1

@nashby
Copy link
Collaborator

@nashby nashby commented on 7348ce1 May 8, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay!

Please sign in to comment.