Class: BootstrapAdmin::ControllerConfig
- Inherits:
-
Object
- Object
- BootstrapAdmin::ControllerConfig
- Defined in:
- lib/bootstrap_admin/controller_config.rb
Overview
Defines each controllers specific configuration
Constant Summary collapse
- DEFAULTS =
{ :responder_formats => [:html, :json] }
Instance Attribute Summary collapse
-
#action_fields ⇒ Object
Fields to be used on ALL actions These are used when none of the action_fields are defined.
-
#available_actions ⇒ Object
Available Actions.
-
#form_fields ⇒ Object
(also: #edit_fields, #new_fields, #create_fields, #update_fields)
Fields to be used on form (edit/new/create/update) actions.
-
#index_fields ⇒ Object
Fields to be used on the index action.
-
#model_name ⇒ Object
Name of the model to be used on this controller (to support namespaced models).
-
#namespace ⇒ Object
controller’s namespace.
-
#permitted_fields ⇒ Object
Returns the value of attribute permitted_fields.
-
#permitted_new_fields ⇒ Object
Returns the value of attribute permitted_new_fields.
-
#permitted_search_fields ⇒ Object
Returns the value of attribute permitted_search_fields.
-
#permitted_update_fields ⇒ Object
Returns the value of attribute permitted_update_fields.
-
#responder_formats ⇒ Object
Responded formats.
-
#searchable_fields ⇒ Object
Searchable fields.
-
#show_fields ⇒ Object
Fields to be used on the show action.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ControllerConfig
constructor
.
Constructor Details
#initialize(options = {}) ⇒ ControllerConfig
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/bootstrap_admin/controller_config.rb', line 46 def initialize = {} = DEFAULTS.merge # namespace @namespace = [:namespace] || BootstrapAdmin.admin_namespace # responder responder_formats @responder_formats = [:responder_formats] # fields to be shown @ index # @index_fields = options[:index_fields] # fields to be shown @ show # @show_fields = options[:show_fields] @available_actions = [:new, :show, :edit, :destroy] end |
Instance Attribute Details
#action_fields ⇒ Object
Fields to be used on ALL actions These are used when none of the action_fields are defined
34 35 36 |
# File 'lib/bootstrap_admin/controller_config.rb', line 34 def action_fields @action_fields end |
#available_actions ⇒ Object
Available Actions
40 41 42 |
# File 'lib/bootstrap_admin/controller_config.rb', line 40 def available_actions @available_actions end |
#form_fields ⇒ Object Also known as: edit_fields, new_fields, create_fields, update_fields
Fields to be used on form (edit/new/create/update) actions
21 22 23 |
# File 'lib/bootstrap_admin/controller_config.rb', line 21 def form_fields @form_fields end |
#index_fields ⇒ Object
Fields to be used on the index action
15 16 17 |
# File 'lib/bootstrap_admin/controller_config.rb', line 15 def index_fields @index_fields end |
#model_name ⇒ Object
Name of the model to be used on this controller (to support namespaced models)
43 44 45 |
# File 'lib/bootstrap_admin/controller_config.rb', line 43 def model_name @model_name end |
#namespace ⇒ Object
controller’s namespace
9 10 11 |
# File 'lib/bootstrap_admin/controller_config.rb', line 9 def namespace @namespace end |
#permitted_fields ⇒ Object
Returns the value of attribute permitted_fields.
30 31 32 |
# File 'lib/bootstrap_admin/controller_config.rb', line 30 def permitted_fields @permitted_fields end |
#permitted_new_fields ⇒ Object
Returns the value of attribute permitted_new_fields.
27 28 29 |
# File 'lib/bootstrap_admin/controller_config.rb', line 27 def permitted_new_fields @permitted_new_fields end |
#permitted_search_fields ⇒ Object
Returns the value of attribute permitted_search_fields.
29 30 31 |
# File 'lib/bootstrap_admin/controller_config.rb', line 29 def permitted_search_fields @permitted_search_fields end |
#permitted_update_fields ⇒ Object
Returns the value of attribute permitted_update_fields.
28 29 30 |
# File 'lib/bootstrap_admin/controller_config.rb', line 28 def permitted_update_fields @permitted_update_fields end |
#responder_formats ⇒ Object
Responded formats
12 13 14 |
# File 'lib/bootstrap_admin/controller_config.rb', line 12 def responder_formats @responder_formats end |
#searchable_fields ⇒ Object
Searchable fields
37 38 39 |
# File 'lib/bootstrap_admin/controller_config.rb', line 37 def searchable_fields @searchable_fields end |
#show_fields ⇒ Object
Fields to be used on the show action
18 19 20 |
# File 'lib/bootstrap_admin/controller_config.rb', line 18 def show_fields @show_fields end |