Class: Qbrick::Cms::AdminsController
- Inherits:
-
BackendController
- Object
- ActionController::Base
- BackendController
- Qbrick::Cms::AdminsController
- Defined in:
- app/controllers/qbrick/cms/admins_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /admins POST /admins.json.
-
#destroy ⇒ Object
DELETE /admins/1 DELETE /admins/1.json.
-
#edit ⇒ Object
GET /admins/1/edit.
-
#index ⇒ Object
GET /admins GET /admins.json.
-
#new ⇒ Object
GET /admins/new.
-
#show ⇒ Object
GET /admins/1 GET /admins/1.json.
-
#update ⇒ Object
PATCH/PUT /admins/1 PATCH/PUT /admins/1.json.
Methods inherited from BackendController
#default_url_options, #reset_remembered_locale, #set_content_locale
Instance Method Details
#create ⇒ Object
POST /admins POST /admins.json
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/qbrick/cms/admins_controller.rb', line 28 def create @admin = Qbrick::Admin.new(admin_params) respond_to do |format| if @admin.save format.html { redirect_to cms_admins_path, notice: 'Admin was successfully created.' } format.json { render :show, status: :created, location: @admin } else format.html { render :new } format.json { render json: @admin.errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /admins/1 DELETE /admins/1.json
58 59 60 61 62 63 64 |
# File 'app/controllers/qbrick/cms/admins_controller.rb', line 58 def destroy @admin.destroy respond_to do |format| format.html { redirect_to cms_admins_url, notice: 'Admin was successfully destroyed.' } format.json { head :no_content } end end |
#edit ⇒ Object
GET /admins/1/edit
23 24 |
# File 'app/controllers/qbrick/cms/admins_controller.rb', line 23 def edit end |
#index ⇒ Object
GET /admins GET /admins.json
8 9 10 |
# File 'app/controllers/qbrick/cms/admins_controller.rb', line 8 def index @admins = Qbrick::Admin.all end |
#new ⇒ Object
GET /admins/new
18 19 20 |
# File 'app/controllers/qbrick/cms/admins_controller.rb', line 18 def new @admin = Qbrick::Admin.new end |
#show ⇒ Object
GET /admins/1 GET /admins/1.json
14 15 |
# File 'app/controllers/qbrick/cms/admins_controller.rb', line 14 def show end |
#update ⇒ Object
PATCH/PUT /admins/1 PATCH/PUT /admins/1.json
44 45 46 47 48 49 50 51 52 53 54 |
# File 'app/controllers/qbrick/cms/admins_controller.rb', line 44 def update respond_to do |format| if @admin.update(admin_params) format.html { redirect_to cms_admins_path, notice: 'Admin was successfully updated.' } format.json { render :show, status: :ok, location: @admin } else format.html { render :edit } format.json { render json: @admin.errors, status: :unprocessable_entity } end end end |