Class: Rails::Angulate::Mappers::FormatValidatorMapper
- Inherits:
-
BaseMapper
- Object
- BaseMapper
- Rails::Angulate::Mappers::FormatValidatorMapper
- Defined in:
- lib/rails/angulate/mappers/format_validator_mapper.rb
Instance Attribute Summary
Attributes inherited from BaseMapper
#attribute, #model, #validator
Instance Method Summary collapse
Methods inherited from BaseMapper
#error_messages, #full_message, inherited, #initialize
Constructor Details
This class inherits a constructor from Rails::Angulate::Mappers::BaseMapper
Instance Method Details
#ng_attributes ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rails/angulate/mappers/format_validator_mapper.rb', line 5 def ng_attributes {}.tap do |attrs| if pattern = [:javascript_format] attrs["ng-pattern"] = pattern elsif pattern = [:with] attrs["ng-pattern"] = javascriptify_pattern(pattern.source) elsif [:without] ActiveSupport::Deprecation.warn(<<-TEXT.strip) Angulate does not support validates_format validation using the without option. Use the 'with' and/or 'javascript_format' options instead. TEXT end end end |