6
7
8
9
10
11
12
13
14
15
16
|
# File 'app/controllers/rest_area/message_controller.rb', line 6
def get
if @message_serializer
render json: @resource.find(params[:id]).send(@message).all, each_serializer: @message_serializer, root:@message
elsif @message_class
render json: { @message => @resource.find(params[:id]).send(@message).all }.to_json(root:false)
elsif @resource.can_send?(@message)
render json: @resource.find(params[:id]).send(@message).to_json(root:false)
else
raise ActionController::RoutingError.new("Resource Does Not Exist")
end
end
|