Module: MailManager::LayoutHelper
- Defined in:
- app/helpers/mail_manager/layout_helper.rb
Instance Method Summary collapse
- #show_title? ⇒ Boolean
- #site_url ⇒ Object
- #title(value = nil, locals = {}) ⇒ Object
- #translate(key, options = {}) ⇒ Object
- #use_show_for_resources? ⇒ Boolean
Instance Method Details
#show_title? ⇒ Boolean
20 21 22 23 24 25 26 27 |
# File 'app/helpers/mail_manager/layout_helper.rb', line 20 def show_title? return @show_title if defined? @show_title true rescue # :nocov: shouldn't happen false # :nocov: end |
#site_url ⇒ Object
29 30 31 32 33 34 35 |
# File 'app/helpers/mail_manager/layout_helper.rb', line 29 def site_url ::MailManager.site_url rescue # :nocov: shouldn't happen "#{[:protocol]||'http'}://#{[:domain]}" # :nocov: end |
#title(value = nil, locals = {}) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'app/helpers/mail_manager/layout_helper.rb', line 3 def title(value=nil, locals={}) if value.nil? @page_title else @page_title = translate( value, locals) "<h1>#{@page_title}</h1>".html_safe end end |
#translate(key, options = {}) ⇒ Object
37 38 39 40 41 |
# File 'app/helpers/mail_manager/layout_helper.rb', line 37 def translate(key, ={}) super(key, .merge(raise: true)) rescue I18n::MissingTranslationData key end |
#use_show_for_resources? ⇒ Boolean
12 13 14 15 16 17 18 |
# File 'app/helpers/mail_manager/layout_helper.rb', line 12 def use_show_for_resources? ::MailManager.use_show_for_resources rescue # :nocov: shouldn't happen false # :nocov: end |