Skip to content

Instantly share code, notes, and snippets.

@phlegx
Created June 1, 2012 15:35
Show Gist options
  • Save phlegx/2852999 to your computer and use it in GitHub Desktop.
Save phlegx/2852999 to your computer and use it in GitHub Desktop.
class PdoChangeType < ActiveRecord::Base
has_one :tabu_criteria, :dependent => :destroy
end
class TabuCriterium < ActiveRecord::Base
belongs_to :pdo_change_type
end
## view index.html.erb:
<% @tabu_criteria.each do |tabu_criterium| %>
<td><%= tabu_criterium.pdo_change_type.name %></td>
...
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment