Created
December 4, 2012 15:33
-
-
Save senny/4205195 to your computer and use it in GitHub Desktop.
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 User < ActiveRecord::Base | |
validates :account_id, :presence => true | |
end | |
# in the View (using simple_form): | |
# | |
# f.select :account, :collection => Account.all |
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
# It would be awesome to validate on the :account_id field but have the error on the :account field | |
class User < ActiveRecord::Base | |
validates :account_id, :presence => true, :error_field => :account | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment