summaryrefslogtreecommitdiff
path: root/app/controllers/forums_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/forums_controller.rb')
-rw-r--r--app/controllers/forums_controller.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb
index ecf570e..cebdf65 100644
--- a/app/controllers/forums_controller.rb
+++ b/app/controllers/forums_controller.rb
@@ -13,6 +13,11 @@ class ForumsController < ApplicationController
[t.sticky ? 0 : 1, -(t.replies.last.try(:created_at) || t.created_at).to_i]
end
@threads = Kaminari.paginate_array(@threads).page(params[:page])
+ respond_to do |format|
+ format.html
+ f = Forum.find_by(id: params[:id])
+ format.json {render json: f.attributes.to_json}
+ end
end
def edit
@@ -92,4 +97,4 @@ class ForumsController < ApplicationController
a = [:name, :position, :role_read_id, :role_write_id] + add
params.require(:forum).permit(a)
end
-end \ No newline at end of file
+end