module ApplicationForm::ClassMethods
Public Instance Methods
_permitted_args()
click to toggle source
# File lib/application_form.rb, line 34 def _permitted_args @_permitted_args || (superclass.respond_to?(:_permitted_args) && superclass._permitted_args) || [] end
check(key, block, field = :base)
click to toggle source
# File lib/application_form.rb, line 38 def check(key, block, field = :base) validate do |form| if !block.call(form) entity_name = self.class.superclass.to_s.tableize.split('/').last.singularize full_key = "#{entity_name}.errors.#{key}" form.add_error_key(field, full_key) end end end
permit(*args)
click to toggle source
# File lib/application_form.rb, line 30 def permit(*args) @_permitted_args = args end