HSTore 매개 변수가 데이터베이스에 저장되지 않은 경우 큰 형식을 저장할 때 무슨 일이 벌어지는 지 이해하기가 힘듭니다. 누군가 내가 명백한 오류라고 추정하는 것을 지적 할 수 있습니까? (나는 빨리 가능한 한 간결하게 유지하기 위해 많은 양의 출력을 손질했습니다.Rails 4.2.5, simple_form, hstore, 중첩 된 양식 - Hstore Hash가 저장시 지속되지 않음
아무 콘솔 출력이 없다, 그것은 허가되지 않은 PARAMS 또는 아무것도에 대해 불평 아니에요. equipment
필드를 discipline
모델이 hstore 열입니다.
을 감안할 때 내 강력한 PARAMS 설정 :
params.require(:profile).permit(
:id,
:user_id,
:gender,
:dob,
..snip..
disciplines_attributes: [
:id,
:profile_id,
:discipline_type,
:distance_in_meters_per_week,
..snip..
:equipment => [
:time_trial_bike,
:road_bike,
:turbo_trainer,
:watt_bike
]
]
내 PARAMS :
다음Parameters: {"utf8"=>"✓", "authenticity_token"=>"XX", "profile"=>
{"gender"=>"male", "dob(1i)"=>"1927", "dob(2i)"=>"3", "dob(3i)"=>"14",
"disciplines_attributes"=>{"0"=>
{"discipline_type"=>"swimming", "distance_in_meters_per_week"=>"",
"equipment"=>
{
"pull_buoy"=>"true",
"paddles"=>"false",
"wetsuit"=>"true",
"fins"=>"false",
"tempo_trainer"=>"false"
}}},
"commit"=>"Create Profile"}
내 inspecte
이{"gender"=>"male", "dob(1i)"=>"1927", "dob(2i)"=>"3", "dob(3i)"=>"14", "height_in_meters"=>"",
"disciplines_attributes"=>{"0"=>{"discipline_type"=>"swimming", "distance_in_meters_per_week"=>"",
"equipment"=>{
"pull_buoy"=>"true",
"paddles"=>"false",
"wetsuit"=>"true",
"fins"=>"false",
"tempo_trainer"=>"false"}}
}
누군가가 장비의 해시가 데이터베이스에 커밋되지 않는 이유 나를 이해하는 데 도움이 : 컨트롤러에서 D 결과 profile_params?
Discipline id: 148, profile_id: 50, discipline_type: "running", distance_in_meters_per_week: "", sessions_per_week: nil, time_per_session_in_minutes: nil, created_at: "2017-03-14 12:02:15", updated_at: "2017-03-14 12:02:15", equipment: nil>]