Module: Resourceable::Controllers::CRUD::InstanceMethods
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/resourceable/controllers/crud.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
57 58 59 60 |
# File 'lib/resourceable/controllers/crud.rb', line 57 def create resource_instance.save respond_with resource_instance end |
#destroy ⇒ Object
70 71 72 73 |
# File 'lib/resourceable/controllers/crud.rb', line 70 def destroy resource_instance.destroy respond_with resource_instance end |
#edit ⇒ Object
62 63 |
# File 'lib/resourceable/controllers/crud.rb', line 62 def edit end |
#index ⇒ Object
44 45 46 47 48 |
# File 'lib/resourceable/controllers/crud.rb', line 44 def index @search = collection_instance.search(search_params) collection_instance! @search.result.page(page_params).per(pagination.per) respond_with collection_instance end |
#new ⇒ Object
54 55 |
# File 'lib/resourceable/controllers/crud.rb', line 54 def new end |
#show ⇒ Object
50 51 52 |
# File 'lib/resourceable/controllers/crud.rb', line 50 def show respond_with resource_instance end |
#update ⇒ Object
65 66 67 68 |
# File 'lib/resourceable/controllers/crud.rb', line 65 def update resource_instance.update_attributes(resource_params) respond_with resource_instance end |