How do I reach a related value in a list?
I have:
<% for page in @pages %>
<% end %>
The model page is related to section with belongs_to.
How do I reach a related value in a list?
I have:
<% for page in @pages %>
<% end %>
The model page is related to section with belongs_to.
Pål Bergström wrote:
How do I reach a related value in a list?
I have:
<% for page in @pages %>
<% end %>
The model page is related to section with belongs_to.
Got it:
page.section.name
I had excluded the related column section_id with a :select so therefore
it didn’t work.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs