Class: Ucpengine::EntriesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Ucpengine::EntriesController
- Defined in:
- app/controllers/ucpengine/entries_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/ucpengine/entries_controller.rb', line 25 def create @entry = Entry.new(entry_params) if @entry.save #redirect_to content_entry_path(@entry), notice: 'Entry was successfully created.' redirect_to content_entries_path, notice: 'Entry was successfully created.' else render :new end end |
#destroy ⇒ Object
44 45 46 47 |
# File 'app/controllers/ucpengine/entries_controller.rb', line 44 def destroy @entry.destroy redirect_to content_entries_path, notice: 'Entry was successfully destroyed.' end |
#edit ⇒ Object
22 23 |
# File 'app/controllers/ucpengine/entries_controller.rb', line 22 def edit end |
#index ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/controllers/ucpengine/entries_controller.rb', line 7 def index @entries = Entry.where(content_type: content_class) @terms_of_use = Entry.where(service_type: 'Terms of Use') @third_party_terms_of_use = Entry.where(service_type: 'Third Party Terms of Use') @privacy_policy = Entry.where(service_type: 'Privacy Policy') @glba_privacy_policy = Entry.where(service_type: 'GLBA Privacy Policy') end |
#new ⇒ Object
18 19 20 |
# File 'app/controllers/ucpengine/entries_controller.rb', line 18 def new @entry = Entry.new(content_type: content_class) end |
#show ⇒ Object
15 16 |
# File 'app/controllers/ucpengine/entries_controller.rb', line 15 def show end |
#update ⇒ Object
36 37 38 39 40 41 42 |
# File 'app/controllers/ucpengine/entries_controller.rb', line 36 def update if @entry.update(entry_params) redirect_to content_entry_path(@entry), notice: 'Entry was successfully updated.' else render :edit end end |