Module: ApplicationHelper
- Defined in:
- app/helpers/application_helper.rb
Instance Method Summary collapse
- #li_link_to_current(name, controller_name, action_name) ⇒ Object
- #nl2br(text) ⇒ Object
- #primary_account_id ⇒ Object
- #show_accounts ⇒ Object
- #user_last_login_at ⇒ Object
Instance Method Details
#li_link_to_current(name, controller_name, action_name) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'app/helpers/application_helper.rb', line 3 def li_link_to_current(name, controller_name, action_name) if current_page?(:controller => controller_name) str = '<li class="current">' + link_to(name, {:controller => controller_name, :action => action_name}) + '</li>' else str = '<li>' + link_to(name, {:controller => controller_name, :action => action_name}) + '</li>' end str.html_safe end |
#nl2br(text) ⇒ Object
20 21 22 |
# File 'app/helpers/application_helper.rb', line 20 def nl2br(text) text.gsub(/(<.*?>)/, '').gsub(/\n/, '<br />').html_safe end |
#primary_account_id ⇒ Object
16 17 18 |
# File 'app/helpers/application_helper.rb', line 16 def primary_account_id User.primary_account_id(@current_user.uuid) end |
#show_accounts ⇒ Object
12 13 14 |
# File 'app/helpers/application_helper.rb', line 12 def show_accounts User.account_name_with_uuid(@current_user.uuid) end |
#user_last_login_at ⇒ Object
24 25 26 |
# File 'app/helpers/application_helper.rb', line 24 def user_last_login_at @current_user.last_login_at.utc.iso8601 end |