Created
November 15, 2012 18:38
Which is better?
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
# admin/real_estate_companies.rb | |
ActiveAdmin.register RealEstateCompany do | |
form do |f| | |
f.inputs do | |
f.input :vendors, collection: Vendor.sorted_by_name | |
end | |
end | |
end | |
# models/vendor.rb | |
class Vendor | |
scope :sorted_by_name, order(:name) | |
end |
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
# admin/real_estate_companies.rb | |
ActiveAdmin.register RealEstateCompany do | |
form do |f| | |
f.inputs do | |
f.input :vendors, collection: Vendor.sorted_for_real_estate_companies_admin | |
end | |
end | |
end | |
# models/vendor.rb | |
class Vendor | |
scope :sorted_for_real_estate_companies_admin, order(:name) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment