annotates legislations instead of proposals

This commit is contained in:
rgarcia
2015-12-15 13:08:53 +01:00
parent f2c14968f3
commit 60d6f1c41b
6 changed files with 21 additions and 19 deletions

View File

@@ -23,7 +23,7 @@ class AnnotationsController < ApplicationController
end
def search
@annotations = Annotation.where(proposal_id: params[:proposal_id])
@annotations = Annotation.where(legislation_id: params[:legislation_id])
annotations_hash = { total: @annotations.size, rows: @annotations }
render json: annotations_hash.to_json
end
@@ -34,6 +34,6 @@ class AnnotationsController < ApplicationController
params
.require(:annotation)
.permit(:quote, :text, ranges: [:start, :startOffset, :end, :endOffset])
.merge(proposal_id: params[:proposal_id], user_id: params[:user_id])
.merge(legislation_id: params[:legislation_id], user_id: params[:user_id])
end
end