Created
June 28, 2013 16:18
-
-
Save carlossanchezp/5885946 to your computer and use it in GitHub Desktop.
ejemplo active admin through
This file contains hidden or 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
| class Brand < ActiveRecord::Base | |
| has_many :car_models | |
| end | |
| class CarModel < ActiveRecord::Base | |
| has_many :production_years | |
| belongs_to :brand | |
| end | |
| class ProductionYear < ActiveRecord::Base | |
| belongs_to :car_model | |
| has_one :brand, :through => :car_model | |
| end | |
| ActiveAdmin.register ProductionYear do | |
| filter :brand, :as => :check_boxes, :collection => proc { Brand.all } | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment