Se agregan anotaciones a propuestas existentes

This commit is contained in:
Abigail Sosa
2015-11-17 16:54:01 -07:00
committed by rgarcia
parent 0d8a233c22
commit 189a6426b1
29 changed files with 638 additions and 3 deletions

View File

@@ -0,0 +1,19 @@
class AnnotationsController < ApplicationController
skip_before_action :verify_authenticity_token
load_and_authorize_resource
def create
@annotation = Annotation.new(annotation_params)
if @annotation.save
render json: @annotation.to_json
end
end
private
def annotation_params
params
.require(:annotation)
.permit(:quote, :text, ranges: [:start, :startOffset, :end, :endOffset])
.merge(proposal_id: params[:proposal_id])
end
end