Skip to content

Instantly share code, notes, and snippets.

@Stephenitis
Created May 23, 2014 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Stephenitis/69d8b7e7fc5baab1effe to your computer and use it in GitHub Desktop.
Save Stephenitis/69d8b7e7fc5baab1effe to your computer and use it in GitHub Desktop.
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