diff --git a/app/controllers/missions_controller.rb b/app/controllers/missions_controller.rb index da3fa43..50a5978 100644 --- a/app/controllers/missions_controller.rb +++ b/app/controllers/missions_controller.rb @@ -58,19 +58,18 @@ class MissionsController < ApplicationController def update #Todo id = params[:id] - body = request.body.read now = Datetime.now mission = Mission.find(id) - mission.name = body[:name] - mission.content = body[:content] - mission.priority = body[:priority] - mission.status = body[:status] - mission.deadline = body[:deadline] + mission.name = params[:name] + mission.content = params[:content] + mission.priority = params[:priority] + mission.status = params[:status] + mission.deadline = params[:deadline] mission.updated_at = now mission.save! pid = mission.project_id Mission_user.destory_all(:mission_id => id) - body[:users].each do |i| + params[:users].each do |i| uid = User.where(:email => i).id mu = Mission_user.new mu.mission_id = id @@ -92,10 +91,9 @@ class MissionsController < ApplicationController def commentPublish #Todo - body = request.body.read put = Comments.new() - put.content = body[:content] - put.mission_id = body[:mission_id] + put.content = params[:content] + put.mission_id = params[:mission_id] put.user_id = session[:user_id] now = Datetime.now put.created_at = now diff --git a/app/controllers/shares_controller.rb b/app/controllers/shares_controller.rb index 1825c57..7af353c 100644 --- a/app/controllers/shares_controller.rb +++ b/app/controllers/shares_controller.rb @@ -6,12 +6,11 @@ class SharesController < ApplicationController def create #Todo - body = request.body.read uid = session[:user_id].to_i - pid = body[:project_id].to_i + pid = params[:project_id].to_i now = Datetime.now put = Share.new() - put.content = body[:content] + put.content = params[:content] put.project_id = pid put.user_id = uid put.created_at = now