Class: DiscussionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- DiscussionsController
- Defined in:
- app/controllers/discussions_controller.rb
Instance Method Summary collapse
-
#close ⇒ Object
TODO: test.
-
#create ⇒ Object
TODO: test.
-
#open ⇒ Object
TODO: test.
-
#remove ⇒ Object
TODO: test.
-
#show ⇒ Object
TODO: test.
Methods included from Zena::App
Instance Method Details
#close ⇒ Object
TODO: test
17 18 19 20 21 |
# File 'app/controllers/discussions_controller.rb', line 17 def close get_discussion @discussion.update_attributes( :open => false ) render :action=>'update' end |
#create ⇒ Object
TODO: test
24 25 26 27 28 29 30 31 |
# File 'app/controllers/discussions_controller.rb', line 24 def create @node = secure(Node) { Node.find(params[:discussion][:node_id])} unless @node processing_error 'node not found' else @discussion = Discussion.create(params[:discussion]) end end |
#open ⇒ Object
TODO: test
10 11 12 13 14 |
# File 'app/controllers/discussions_controller.rb', line 10 def open get_discussion @discussion.update_attributes( :open => true ) render :action=>'update' end |
#remove ⇒ Object
TODO: test
34 35 36 37 |
# File 'app/controllers/discussions_controller.rb', line 34 def remove get_discussion @discussion.destroy end |
#show ⇒ Object
TODO: test
4 5 6 7 |
# File 'app/controllers/discussions_controller.rb', line 4 def show get_discussion @comments = @discussion.comments end |