Module: MembershipTypesHelper
- Defined in:
- app/helpers/membership_types_helper.rb
Instance Method Summary collapse
- #membership_type_storefront_path(membership_type) ⇒ Object
- #options_for_membership_types(types, opts = {}) ⇒ Object
Instance Method Details
#membership_type_storefront_path(membership_type) ⇒ Object
2 3 4 |
# File 'app/helpers/membership_types_helper.rb', line 2 def membership_type_storefront_path(membership_type) url_for(organization_slug: membership_type.organization.cached_slug, controller: 'store/memberships', action: 'show', id: membership_type.id) end |
#options_for_membership_types(types, opts = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/helpers/membership_types_helper.rb', line 6 def (types, opts={}) = { :include_price => false } = = .merge(opts) unless opts.blank? items = types.map do |type| name = type.name name << (' - $%.2f' % number_to_dollars(type.price)) if [:include_price] [name, type.id] end items end |