Module: BackOffice::Rest
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/back_office/rest.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/back_office/rest.rb', line 5 def create resource.attributes = resource_params if resource.save created success else failure end end |
#destroy ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/back_office/rest.rb', line 25 def destroy if resource.destroy deleted success else failure end end |
#update ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/back_office/rest.rb', line 16 def update if resource.update(resource_params) updated success else failure end end |