Class: Knitkit::CommentsController
- Inherits:
-
BaseController
- Object
- ErpApp::ApplicationController
- BaseController
- Knitkit::CommentsController
- Defined in:
- app/controllers/knitkit/comments_controller.rb
Instance Method Summary collapse
- #add ⇒ Object
-
#set_section ⇒ Object
no section to set.
Methods inherited from BaseController
#view_current_publication, #website
Instance Method Details
#add ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'app/controllers/knitkit/comments_controller.rb', line 3 def add user = current_user content = Content.find(params[:content_id]) comment = params[:comment] @comment = content.add_comment({:commentor_name => user.party.description, :email => user.email, :comment => comment}) render :text => (@comment.valid? ? '<div class="sexynotice">Comment pending approval.</div>' : '<div class="sexynotice">Error. Comment cannot be blank.</div>') end |
#set_section ⇒ Object
no section to set
14 15 16 |
# File 'app/controllers/knitkit/comments_controller.rb', line 14 def set_section return false end |