Created
May 23, 2014 19:54
-
-
Save Stephenitis/69d8b7e7fc5baab1effe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in controller | |
def show | |
@contract = Contract.find(1) # you'll normally take a number from params instead | |
@orders = @contract.orders | |
end | |
in your view aka show.html.erb | |
<ul> | |
<% @orders.each do |order| %> | |
<li><%= order %> </li> | |
<% end %> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment