Added more json support
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user