Module: ResourcesController::RestActions
- Extended by:
- ActiveSupport::Concern
- Included in:
- Base
- Defined in:
- app/concerns/resources_controller/rest_actions.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
42 43 44 45 |
# File 'app/concerns/resources_controller/rest_actions.rb', line 42 def create @resource.save respond_with(respond_with_namespace, @resource) end |
#destroy ⇒ Object
37 38 39 40 |
# File 'app/concerns/resources_controller/rest_actions.rb', line 37 def destroy @resource.destroy respond_with(respond_with_namespace, @resource) end |
#edit ⇒ Object
26 |
# File 'app/concerns/resources_controller/rest_actions.rb', line 26 def edit; end |
#index ⇒ Object
23 |
# File 'app/concerns/resources_controller/rest_actions.rb', line 23 def index; end |
#new ⇒ Object
24 |
# File 'app/concerns/resources_controller/rest_actions.rb', line 24 def new; end |
#show ⇒ Object
25 |
# File 'app/concerns/resources_controller/rest_actions.rb', line 25 def show; end |
#update ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'app/concerns/resources_controller/rest_actions.rb', line 28 def update if Rails::VERSION::MAJOR < 4 @resource.update_attributes(permitted_params) else @resource.update(permitted_params) end respond_with(respond_with_namespace, @resource) end |