Module: EIVO::Concerns::Resource
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/controllers/eivo/concerns/resource.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/eivo/concerns/resource.rb', line 16 def create @object ||= collection.new @object.assign_attributes(object_params_create) if @object.save render :new else redirect_to action: :index end end |
#destroy ⇒ Object
42 43 44 45 46 47 |
# File 'app/controllers/eivo/concerns/resource.rb', line 42 def destroy @object ||= collection @object.destroy redirect_to action: :index end |
#edit ⇒ Object
27 28 29 |
# File 'app/controllers/eivo/concerns/resource.rb', line 27 def edit @object ||= collection end |
#new ⇒ Object
12 13 14 |
# File 'app/controllers/eivo/concerns/resource.rb', line 12 def new @object ||= collection.new end |
#show ⇒ Object
8 9 10 |
# File 'app/controllers/eivo/concerns/resource.rb', line 8 def show @object ||= collection end |
#update ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/eivo/concerns/resource.rb', line 31 def update @object ||= collection @object.assign_attributes(object_params_update) if @object.save render :edit else redirect_to action: :index end end |