Module: Resourcery::ControllerExtensions::InstanceMethods
- Defined in:
- lib/resourcery/controller_extensions.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
41 42 43 44 |
# File 'lib/resourcery/controller_extensions.rb', line 41 def create resource.save respond_with resource end |
#destroy ⇒ Object
46 47 48 49 |
# File 'lib/resourcery/controller_extensions.rb', line 46 def destroy resource.destroy redirect_to resource_class end |
#edit ⇒ Object
28 29 30 |
# File 'lib/resourcery/controller_extensions.rb', line 28 def edit respond_with resource end |
#index ⇒ Object
20 21 22 |
# File 'lib/resourcery/controller_extensions.rb', line 20 def index respond_with collection end |
#new ⇒ Object
37 38 39 |
# File 'lib/resourcery/controller_extensions.rb', line 37 def new respond_with resource_ivar end |
#show ⇒ Object
24 25 26 |
# File 'lib/resourcery/controller_extensions.rb', line 24 def show respond_with resource end |
#update ⇒ Object
32 33 34 35 |
# File 'lib/resourcery/controller_extensions.rb', line 32 def update resource.update_attributes(params[singular_resource_name]) respond_with resource end |