On Dec 2, 2014, at 8:15 PM, Dmoneyzzz Darko <li...@ruby-forum.com> wrote:

> Scott Ribe wrote in post #1163866:
>> {
>>  "utf8"=>"✓",
>>  "authenticity_token"=>"3aeYhNBVYaFdHpPHWR5qpoD3QDB8PRUJIiR94WC1kag=",
>>  "appointment"=>{
>>    "physician_id"=>"4",
>>    "patient_id"=>"8",
>>    "reason"=>"fdsdfs",
>>    "appointment_date(1i)"=>"2014",
>>    "appointment_date(2i)"=>"12",
>>    "appointment_date(3i)"=>"3",
>>    "diagnostic_code_id"=>"1",
>>    "notes"=>"sdfsdfs",
>>    "appt_completion"=>"true"
>>  },
>>  "appointment_time"=>{
>>    "test"=>"7"
>>  },
>>  "commit"=>"Create Appointment"
>> }
> 
> 
> Is my problem the formatting of the appointment_time field in the 
> appointments params?  Or is the value that is planned for insert 
> constrained by a single string input such as "7" rather than "test" => 
> "7"?
> 
> I tried to remove the "test" => segment to just leave the index, or even 
> better retrieve the value.  I don't see any spelling errors, but I do 
> know the insert is not typical of String values.

I think he's trying to point out to you that the appointment_time field is not 
inside the appointment hash. So when that hash is used to update the 
@appointment instance, that value will not be added to it. It comes back around 
to how your form element was made. If you used the "bound" form helpers, as in 
f.text_field(:appointment_time) to make it, then the name attribute in the HTML 
would be <input name="appointment[appointment_time]" ...> and the value of that 
variable would be in the appointment hash. 

Walter

> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/13ff08f5365250979047979bcf8a3909%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/E21F12A8-E570-41B3-93B6-818E131FA4B2%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to