Class: Admin::ForumsController
- Inherits:
-
AdminController
- Object
- AdminController
- Admin::ForumsController
- Defined in:
- app/controllers/formol/admin/forums_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #new ⇒ Object
- #reorganize ⇒ Object
- #update ⇒ Object
Methods included from Formol::Controllers::Nested::HasParentCategory
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/formol/admin/forums_controller.rb', line 14 def create if forum.save respond_with(forum, :status => :created, :location => admin_categories_path) else respond_with(forum, :status => :unprocessable_entity) do |format| format.html { render :new } end end end |
#destroy ⇒ Object
38 39 40 41 42 |
# File 'app/controllers/formol/admin/forums_controller.rb', line 38 def destroy forum.destroy respond_with(forum, :location => admin_categories_path) end |
#edit ⇒ Object
24 25 26 |
# File 'app/controllers/formol/admin/forums_controller.rb', line 24 def edit forum end |
#new ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/formol/admin/forums_controller.rb', line 8 def new forum respond_with(forum) end |
#reorganize ⇒ Object
44 45 46 47 48 |
# File 'app/controllers/formol/admin/forums_controller.rb', line 44 def reorganize Formol::Forum.reorganize(params[:forums], params[:category_id]) render :nothing => true, :status => :ok end |
#update ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/formol/admin/forums_controller.rb', line 28 def update if forum.update_attributes(params[:forum]) respond_with(forum, :location => admin_categories_path) else respond_with(forum) do |format| format.html { render :edit } end end end |