diff options
Diffstat (limited to 'app/controllers/subparticipants_controller.rb')
-rw-r--r-- | app/controllers/subparticipants_controller.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/app/controllers/subparticipants_controller.rb b/app/controllers/subparticipants_controller.rb index a96d399..daf1b72 100644 --- a/app/controllers/subparticipants_controller.rb +++ b/app/controllers/subparticipants_controller.rb @@ -49,14 +49,13 @@ class SubparticipantsController < ApplicationController end def create - sender= @participant begin json_data= ActiveSupport::JSON.decode request.raw_post rescue ActiveSupport::OkJson::Error, StandardError raise Ecs::InvalidMessageException, "You have provided invalid JSON data (SubparticipantsController#create)." end unless request.raw_post.empty? logger.debug "request raw post: #{(request.raw_post.empty?)?'<empty>':request.raw_post}" - subparticipant= Subparticipant.generate(sender, json_data) + subparticipant= Subparticipant.generate(@participant, json_data) body= show_render(subparticipant) respond_to do |format| format.json { render :json => JSON.pretty_generate(body) + "\r\n", :location => location(subparticipant) } @@ -70,9 +69,8 @@ class SubparticipantsController < ApplicationController rescue StandardError raise Ecs::InvalidMessageException, "You have provided invalid JSON data (SubparticipantsController#update)." end unless request.raw_post.empty? - sender= @participant subparticipant= Subparticipant.find(params[:id]) - subparticipant.update__(sender, json_data, subparticipant) + subparticipant.update__(@participant, json_data, subparticipant) body= show_render(subparticipant) respond_to do |format| format.json { render :json => JSON.pretty_generate(body) + "\r\n", :location => location(subparticipant) } @@ -113,10 +111,6 @@ private end end - def check_communities - - end - def location(subparticipant) location = request.protocol + request.host location += ":" + request.port.to_s unless [80, 443].include?(request.port) |