Class: Cfp::CommentsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Cfp::CommentsController
- Defined in:
- app/controllers/cfp/comments_controller.rb
Instance Method Summary collapse
Instance Method Details
#check_for_reviewer ⇒ Object
26 27 28 |
# File 'app/controllers/cfp/comments_controller.rb', line 26 def check_for_reviewer redirect_to :proposals unless current_user.can_review? end |
#create ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/cfp/comments_controller.rb', line 16 def create @comment = @proposal.comments.build(params[:comment]) @comment.user = current_user if @comment.save redirect_to proposal_comments_path(@proposal) else render :action => :new end end |
#index ⇒ Object
8 9 10 |
# File 'app/controllers/cfp/comments_controller.rb', line 8 def index @comments = @proposal.comments end |
#load_proposal ⇒ Object
30 31 32 |
# File 'app/controllers/cfp/comments_controller.rb', line 30 def load_proposal @proposal = Proposal.find(params[:proposal_id]) end |
#new ⇒ Object
12 13 14 |
# File 'app/controllers/cfp/comments_controller.rb', line 12 def new @comment = Comment.new end |