On 5 November 2015 at 10:32, Deepak Sharma <deeky.sharma@gmail.com> wrote:
> ...
> Now I want to fetch
> same for consultant table i.e fetching consultant data in patient index
> file.
>
> Rough example :
>
> <tbody>
> <% @departments.each do |d| %>
> <% d.patients.each do |patient| %>
> <tr>
> <td><%= patient.patient_name %></td>
> <td><%= d.name %></td>
> <% @consultants.each do |c| %>
> <td><%= c.name %></td>
> <% end %>
> </tr>
> <% end %>
> <% end %>
> </tbody>
>
> Something like above which fetch name field from consultant table in
> patient's index file according to their respective ID.
What is the relationship between consultants and patients, that is in
terms of has_many, belongs_to etc?
Colin
--
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+unsubscribe@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/CAL%3D0gLua1rj%2BE8Evtwx-Fmc_X9hXukBj%3DoEs9ob1K_fTVczNdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment