We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Right now Im using virtus in my rails project but Im having a problem to validate class attributes. This are the codes:
class NewAccountForm include Virtus extend ActiveModel::Naming extend ActiveModel::Conversion extend ActiveModel::Validations attribute :username, String attribute :user_type, String attribute :profile, ProfileAttribute validates_presence_of :username, :user_type end
class ProfileAttribute include Virtus extend ActiveModel::Validations attribute :firstname, String attribute :middlename, String attribute :lastname, String attribute :email, String validates_presence_of :firstname, :middlename, :lastname, :email end
my form Im using client_side_validation gem
= form_for @account, url: accounts_path, validate: true do |f| = f.text_field :username = f.fields_for :profile do |profile| = profile.text_field :firstname = profile.text_field :middlename = profile.text_field :lastname
I set validations in ProfileAttribute class but it didn't work. How can I get the validation from class attribute?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Right now Im using virtus in my rails project but Im having a problem to validate class attributes.
This are the codes:
my form Im using client_side_validation gem
I set validations in ProfileAttribute class but it didn't work. How can I get the validation from class attribute?
The text was updated successfully, but these errors were encountered: