Class: RailsPageComment::PageCommentsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/rails_page_comment/page_comments_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#mailer_set_url_options

Instance Method Details

#createObject

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

#editObject

GET /page_comments/1/edit



22
23
# File 'app/controllers/rails_page_comment/page_comments_controller.rb', line 22

def edit
end

#indexObject

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

#newObject

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

#showObject

GET /page_comments/1



13
14
# File 'app/controllers/rails_page_comment/page_comments_controller.rb', line 13

def show
end

#updateObject

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