Module: BootstrapAdmin::Actions::InstanceMethods
- Defined in:
- lib/bootstrap_admin/actions.rb
Overview
The actual controller action methods!
Instance Method Summary collapse
-
#create ⇒ Object
Creates a new item.
-
#destroy ⇒ Object
Destroys an existing item.
-
#edit ⇒ Object
Displays the form to edit an existing item.
-
#index ⇒ Object
Lists (all) items.
-
#new ⇒ Object
Displays the form to create a new item.
-
#show ⇒ Object
Shows a specific item.
-
#update ⇒ Object
Updates the existing item.
Instance Method Details
#create ⇒ Object
Creates a new item
30 31 32 33 34 |
# File 'lib/bootstrap_admin/actions.rb', line 30 def create instance model_class.new(params[model_name]) instance.save namespaced_response instance end |
#destroy ⇒ Object
Destroys an existing item
49 50 51 52 |
# File 'lib/bootstrap_admin/actions.rb', line 49 def destroy instance.destroy namespaced_response instance end |
#edit ⇒ Object
Displays the form to edit an existing item
38 |
# File 'lib/bootstrap_admin/actions.rb', line 38 def edit; namespaced_response instance; end |
#index ⇒ Object
Lists (all) items
18 |
# File 'lib/bootstrap_admin/actions.rb', line 18 def index; namespaced_response collection; end |
#new ⇒ Object
Displays the form to create a new item
26 |
# File 'lib/bootstrap_admin/actions.rb', line 26 def new; namespaced_response instance; end |
#show ⇒ Object
Shows a specific item
22 |
# File 'lib/bootstrap_admin/actions.rb', line 22 def show; namespaced_response instance; end |
#update ⇒ Object
Updates the existing item
42 43 44 45 |
# File 'lib/bootstrap_admin/actions.rb', line 42 def update instance.update_attributes params[model_name] namespaced_response instance end |