Class: Caboose::BlockTypeStoreController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Caboose::BlockTypeStoreController
- Defined in:
- app/controllers/caboose/block_type_store_controller.rb
Instance Method Summary collapse
-
#admin_details ⇒ Object
GET /admin/block-types/store/:block_type_summary_id.
-
#admin_download ⇒ Object
GET /admin/block-types/store/:block_type_summary_id/download.
-
#admin_index ⇒ Object
GET /admin/block-types/store.
Methods inherited from ApplicationController
#admin_add, #admin_bulk_add, #admin_bulk_delete, #admin_bulk_update, #admin_delete, #admin_edit, #admin_json, #admin_json_single, #admin_update, #before_action, #before_before_action, #hashify_query_string, #init_cart, #logged_in?, #logged_in_user, #login_user, #logout_user, #parse_url_params, #reject_param, #user_is_allowed, #user_is_allowed_to, #validate_cookie, #validate_token, #var, #verify_logged_in
Instance Method Details
#admin_details ⇒ Object
GET /admin/block-types/store/:block_type_summary_id
24 25 26 27 28 |
# File 'app/controllers/caboose/block_type_store_controller.rb', line 24 def admin_details return unless user_is_allowed('blocktypestore', 'add') @block_type_summary = BlockTypeSummary::find(params[:block_type_summary_id]) render :layout => 'caboose/admin' end |
#admin_download ⇒ Object
GET /admin/block-types/store/:block_type_summary_id/download
31 32 33 34 35 36 37 38 39 |
# File 'app/controllers/caboose/block_type_store_controller.rb', line 31 def admin_download return unless user_is_allowed('blocktypestore', 'add') bts = BlockTypeSummary::find(params[:block_type_summary_id]) bts.source.refresh(bts.name) resp = StdClass.new('success' => 'The block type has been downloaded successfully.') render :json => resp end |
#admin_index ⇒ Object
GET /admin/block-types/store
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/caboose/block_type_store_controller.rb', line 6 def admin_index return unless user_is_allowed('blocktypestore', 'add') @pager = PageBarGenerator.new(params, { 'block_type_source_id' => '', 'name_like' => '', 'description_like' => '' },{ 'model' => 'Caboose::BlockTypeSummary', 'sort' => 'block_type_source_id, name', 'desc' => false, 'base_url' => '/admin/block-types/store', 'use_url_params' => false }) @block_type_summaries = @pager.items render :layout => 'caboose/admin' end |