Added more json support

This commit is contained in:
MrYummy
2017-07-01 04:44:00 +02:00
parent 0972181e75
commit 361b15e398
4 changed files with 41 additions and 6 deletions

View File

@@ -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
end