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 Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#well_known ⇒ Object
readonly
Returns the value of attribute well_known.
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
7 8 9 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 7 def collection @collection end |
#well_known ⇒ Object (readonly)
Returns the value of attribute well_known.
7 8 9 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 7 def well_known @well_known end |
Instance Method Details
#create ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 29 def create @well_known = WellKnown.new(well_known_params) if @well_known.save redirect_to admin_well_known_path(well_known), status: :see_other else render :new, locals: { well_known: }, status: :unprocessable_content end end |
#destroy ⇒ Object
47 48 49 50 51 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 47 def destroy @well_known.destroy! redirect_to admin_well_knowns_path, status: :see_other end |
#edit ⇒ Object
25 26 27 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 25 def edit render locals: { well_known: } end |
#index ⇒ Object
9 10 11 12 13 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 9 def index @collection = Collection.new.with_params(params).apply(WellKnown.strict_loading.all) render locals: { collection: } end |
#new ⇒ Object
19 20 21 22 23 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 19 def new @well_known = WellKnown.new render locals: { well_known: } end |
#show ⇒ Object
15 16 17 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 15 def show render locals: { well_known: } end |
#update ⇒ Object
39 40 41 42 43 44 45 |
# File 'app/controllers/admin/well_knowns_controller.rb', line 39 def update if well_known.update(well_known_params) redirect_to admin_well_known_path(well_known), status: :see_other else render :edit, locals: { well_known: }, status: :unprocessable_content end end |