Class: Plug::SiteNoticesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Plug::SiteNoticesController
- Defined in:
- app/controllers/plug/site_notices_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /site_notices.
-
#destroy ⇒ Object
DELETE /site_notices/1.
-
#edit ⇒ Object
GET /site_notices/1/edit.
-
#index ⇒ Object
GET /site_notices.
-
#new ⇒ Object
GET /site_notices/new.
-
#update ⇒ Object
PATCH/PUT /site_notices/1.
Instance Method Details
#create ⇒ Object
POST /site_notices
28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/plug/site_notices_controller.rb', line 28 def create @site_notice = SiteNotice.new(site_notice_params) if @site_notice.save redirect_to site_notices_path, notice: 'Site Notice was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE /site_notices/1
48 49 50 51 |
# File 'app/controllers/plug/site_notices_controller.rb', line 48 def destroy @site_notice.destroy redirect_to site_notices_url, notice: 'Site Notice was successfully destroyed.' end |
#edit ⇒ Object
GET /site_notices/1/edit
25 |
# File 'app/controllers/plug/site_notices_controller.rb', line 25 def edit; end |
#index ⇒ Object
GET /site_notices
12 13 14 |
# File 'app/controllers/plug/site_notices_controller.rb', line 12 def index @site_notices = SiteNotice.all end |
#new ⇒ Object
GET /site_notices/new
20 21 22 |
# File 'app/controllers/plug/site_notices_controller.rb', line 20 def new @site_notice = SiteNotice.new end |
#update ⇒ Object
PATCH/PUT /site_notices/1
39 40 41 42 43 44 45 |
# File 'app/controllers/plug/site_notices_controller.rb', line 39 def update if @site_notice.update_attributes(site_notice_params) redirect_to site_notices_path, notice: 'Site Notice was successfully updated.' else render :edit end end |