Class: RailsPageComment::PageCommentsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- RailsPageComment::PageCommentsController
- Defined in:
- app/controllers/rails_page_comment/page_comments_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /page_comments.
-
#edit ⇒ Object
GET /page_comments/1/edit.
-
#index ⇒ Object
GET /page_comments.
-
#new ⇒ Object
GET /page_comments/new.
-
#show ⇒ Object
GET /page_comments/1.
-
#update ⇒ Object
PATCH/PUT /page_comments/1.
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
POST /page_comments
26 27 28 29 30 31 32 33 |
# File 'app/controllers/rails_page_comment/page_comments_controller.rb', line 26 def create @page_comment = PageComment.new(create_page_comment_params) if @page_comment.save render :edit else render :nothing => true end end |
#edit ⇒ Object
GET /page_comments/1/edit
22 23 |
# File 'app/controllers/rails_page_comment/page_comments_controller.rb', line 22 def edit end |
#index ⇒ Object
GET /page_comments
8 9 10 |
# File 'app/controllers/rails_page_comment/page_comments_controller.rb', line 8 def index @page_comments = PageComment.all end |
#new ⇒ Object
GET /page_comments/new
17 18 19 |
# File 'app/controllers/rails_page_comment/page_comments_controller.rb', line 17 def new @page_comment = PageComment.new end |
#show ⇒ Object
GET /page_comments/1
13 14 |
# File 'app/controllers/rails_page_comment/page_comments_controller.rb', line 13 def show end |
#update ⇒ Object
PATCH/PUT /page_comments/1
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'app/controllers/rails_page_comment/page_comments_controller.rb', line 36 def update @page_comment.attributes = update_page_comment_params if @page_comment.valid? if @page_comment.changed? RailsPageComment.notify_changes_method_name.each do |m| self.class.notify_changes_class.send(m, @page_comment).deliver end end @page_comment.save render :edit else render :edit end end |