Module: Tellimus::ApplicationHelper
- Defined in:
- app/helpers/tellimus/application_helper.rb
Instance Method Summary collapse
- #plan_interval(plan) ⇒ Object
- #plan_price(plan) ⇒ Object
-
#tellimus_controller? ⇒ Boolean
returns TRUE if the controller belongs to Tellimus false in all other cases, for convenience when executing filters in the main application.
Instance Method Details
#plan_interval(plan) ⇒ Object
8 9 10 11 |
# File 'app/helpers/tellimus/application_helper.rb', line 8 def plan_interval(plan) interval = %w(month year week 6-month 3-month).include?(plan.interval) ? plan.interval.delete('-') : 'month' I18n.t("tellimus.plan_intervals.#{interval}") end |
#plan_price(plan) ⇒ Object
4 5 6 |
# File 'app/helpers/tellimus/application_helper.rb', line 4 def plan_price(plan) "#{number_to_currency(plan.price)}/#{plan_interval(plan)}" end |
#tellimus_controller? ⇒ Boolean
returns TRUE if the controller belongs to Tellimus false in all other cases, for convenience when executing filters in the main application
16 17 18 |
# File 'app/helpers/tellimus/application_helper.rb', line 16 def tellimus_controller? is_a? Tellimus::ApplicationController end |