Module: Mails::ApplicationHelper
- Defined in:
- app/helpers/mails/application_helper.rb
Instance Method Summary collapse
Instance Method Details
#notice_message ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/helpers/mails/application_helper.rb', line 14 def = [] flash.each do |type, | type = :danger type = :success if type.to_sym == :notice = raw %(<button type="button" class="close" data-dismiss="alert">×</button>) text = content_tag(:div, + , class: "alert alert-dismissible alert-#{type}") << text if end .join("\n").html_safe end |
#render_errors(target) ⇒ Object
3 4 5 6 7 |
# File 'app/helpers/mails/application_helper.rb', line 3 def render_errors(target) if target.errors.present? render partial: '/homeland/shared/error_messages', locals: { target: target } end end |
#timeago(time, options = {}) ⇒ Object
9 10 11 12 |
# File 'app/helpers/mails/application_helper.rb', line 9 def timeago(time, = {}) [:class] ||= "timeago" content_tag(:abbr, time.to_s, .merge(:title => time.getutc.iso8601)) if time end |