Module: Spree::StoreHelper
- Defined in:
- app/helpers/spree/store_helper.rb
Overview
Methods added to this helper will be available to all templates in the frontend.
Instance Method Summary collapse
- #cache_key_for_taxons ⇒ Object
-
#store_menu? ⇒ Boolean
True when it is appropriate to show the store menu.
Instance Method Details
#cache_key_for_taxons ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'app/helpers/spree/store_helper.rb', line 12 def cache_key_for_taxons Spree::Deprecation.warn " cache_key_for_taxons is deprecated. Rails >= 5 has built-in support for collection cache keys.\n Instead in your view use:\n cache [I18n.locale, @taxons] do\n WARN\n max_updated_at = @taxons.maximum(:updated_at).to_i\n parts = [@taxon.try(:id), max_updated_at].compact.join(\"-\")\n \"\#{I18n.locale}/taxons/\#{parts}\"\nend\n".strip_heredoc |
#store_menu? ⇒ Boolean
Returns true when it is appropriate to show the store menu.
8 9 10 |
# File 'app/helpers/spree/store_helper.rb', line 8 def %w{thank_you}.exclude? params[:action] end |