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