Class: Admin::WellKnownsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Admin::WellKnownsController
- Defined in:
- app/controllers/admin/well_knowns_controller.rb
Defined Under Namespace
Classes: Collection
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 25 def create @well_known = ::WellKnown.new(well_known_params) if @well_known.save redirect_to [:admin, @well_known], status: :see_other else render :new, locals: { well_known: @well_known }, status: :unprocessable_content end end |
#destroy ⇒ Object
43 44 45 46 47 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 43 def destroy @well_known.destroy! redirect_to action: :index, status: :see_other end |
#edit ⇒ Object
21 22 23 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 21 def edit render locals: { well_known: @well_known } end |
#index ⇒ Object
7 8 9 10 11 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 7 def index collection = Collection.new.with_params(params).apply(::WellKnown.strict_loading.all) render locals: { collection: } end |
#new ⇒ Object
17 18 19 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 17 def new render locals: { well_known: ::WellKnown.new } end |
#show ⇒ Object
13 14 15 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 13 def show render locals: { well_known: @well_known } end |
#update ⇒ Object
35 36 37 38 39 40 41 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 35 def update if @well_known.update(well_known_params) redirect_to action: :show, status: :see_other else render :edit, locals: { well_known: @well_known }, status: :unprocessable_content end end |