Further updates on my question above:what if I have a helper method to store the "current_patient", having always the last patient from my search query and on my hospitalizations_controller I build the Create method something like this: @hospitalization = current_patient.hospitalizations.new(hospitalization_params) ? Would this be the best way to work around this?
--
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-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3b5be9c1-6efc-4920-85d6-9a89c52a008f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Also checkout accepted_nested_resource I think it is? I'm on my phone currently...this would be placed in your model
--Rob
Sent from my cell, please excuse any typos.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAOHSkmHW%3DFa1YirbuBXmnBmhJecVGqQ8yDK6qDT98bgBjZxSog%40mail.gmail.com.
Nested resource is the way to go.
--Rob
Sent from my cell, please excuse any typos.
--
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-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/702789B2-47B5-4543-A5A9-395ED59A56AB%40elevated-dev.com.
Nested resource is the way to go.
--Rob
Sent from my cell, please excuse any typos.
On Jan 15, 2015 1:15 PM, "Scott Ribe" <scott...@elevated-dev.com> wrote:
On Jan 15, 2015, at 11:03 AM, Diego Dillenburg Bueno <diegodi...@gmail.com> wrote:
>
> For now I had solved this issue storing the patient_id in the session, any information on this solution?
That sounds like a bad idea. What if the user has more than one window open, or manages to use the back button to get to a hospitalization for a different patient?
I'd think that patient_id for a new hospitalization ought to go into a hidden field in the form.
--
Scott Ribe
scott...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567Â voice