def save_bmi_measurement
return error_response(INVALID_REQUEST, "required parameters are missing") unless params[:access_code].present? && params[:auth_token].present? && params[:weight].present? && params[:w_unit].present? && params[:h_unit].present? && params[:bmi].present?
@participantBmiLog = ParticipantBmiLog.new(:weight => params[:weight], :w_unit => params[:w_unit],:h_unit=>:params[:h_unit],:height=>params[:height],:bmi=>params[:bmi],:measured_date=>params[:measured_date])
#...
has_many :bmi_logs,:class_name => "ParticipantBMILog", :dependent => :destroy
belongs_to :participant
belongs_to :research_info
attr_accessible :weight,:w_unit,:h_unit,:height,:bmi,:measured_date,:participant_id,:research_info_id
我在rails 3.2.19中获得了can't convert Symbol into Integer
。请帮帮我。
答案 0 :(得分:0)
看到这个你正在写符号作为符号
:h_unit=>:params[:h_unit]
应该是
:h_unit=>params[:h_unit]