Class: Comable::Admin::StoreController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Comable::Admin::StoreController
- Defined in:
- app/controllers/comable/admin/store_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /admin/store.
-
#edit ⇒ Object
GET /admin/store/edit.
-
#new ⇒ Object
GET /admin/store/new.
-
#show ⇒ Object
GET /admin/store.
-
#update ⇒ Object
PATCH/PUT /admin/store.
Instance Method Details
#create ⇒ Object
POST /admin/store
23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/comable/admin/store_controller.rb', line 23 def create @store = Comable::Store.new(store_params) if @store.save redirect_to comable.admin_store_url(@store), notice: 'Store was successfully created.' else render :new end end |
#edit ⇒ Object
GET /admin/store/edit
18 19 20 |
# File 'app/controllers/comable/admin/store_controller.rb', line 18 def edit @store = Comable::Store.first end |
#new ⇒ Object
GET /admin/store/new
13 14 15 |
# File 'app/controllers/comable/admin/store_controller.rb', line 13 def new @store = Comable::Store.new end |
#show ⇒ Object
GET /admin/store
7 8 9 10 |
# File 'app/controllers/comable/admin/store_controller.rb', line 7 def show @store = Comable::Store.first return redirect_to action: :new unless @store end |
#update ⇒ Object
PATCH/PUT /admin/store
34 35 36 37 38 39 40 41 |
# File 'app/controllers/comable/admin/store_controller.rb', line 34 def update @store = Comable::Store.first if @store.update(store_params) redirect_to comable.admin_store_url(@store), notice: 'Store was successfully updated.' else render :edit end end |