Module: Enjoy::Catalog::Controllers::Items
- Extended by:
- ActiveSupport::Concern
- Included in:
- ItemsController
- Defined in:
- lib/enjoy/catalog/controllers/items.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/enjoy/catalog/controllers/items.rb', line 12 def index @item = item_class.enabled.sorted if unless Enjoy::Catalog.config.items_per_page.nil? @item = @item.page(params[:page]) end end |
#show ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/enjoy/catalog/controllers/items.rb', line 21 def show @item = item_class.enabled.find(params[:id]) if @item and @item.text_slug != params[:id] redirect_to @item, status_code: 301 return true end if Enjoy::Catalog.config. if @item.name, url_for(@item), if: :insert_breadcrumbs end end |