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
26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/plug/site_notices_controller.rb', line 26 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
46 47 48 49 |
# File 'app/controllers/plug/site_notices_controller.rb', line 46 def destroy @site_notice.destroy redirect_to site_notices_url, notice: 'Site Notice was successfully destroyed.' end |
#edit ⇒ Object
GET /site_notices/1/edit
23 |
# File 'app/controllers/plug/site_notices_controller.rb', line 23 def edit; end |
#index ⇒ Object
GET /site_notices
10 11 12 |
# File 'app/controllers/plug/site_notices_controller.rb', line 10 def index @site_notices = SiteNotice.all end |
#new ⇒ Object
GET /site_notices/new
18 19 20 |
# File 'app/controllers/plug/site_notices_controller.rb', line 18 def new @site_notice = SiteNotice.new end |
#update ⇒ Object
PATCH/PUT /site_notices/1
37 38 39 40 41 42 43 |
# File 'app/controllers/plug/site_notices_controller.rb', line 37 def update if @site_notice.update(site_notice_params) redirect_to site_notices_path, notice: 'Site Notice was successfully updated.' else render :edit end end |