class Judge::FormBuilder

Public Instance Methods

check_box(method, options = {}, checked_value = "1", unchecked_value = "0") click to toggle source
Calls superclass method
# File lib/judge/form_builder.rb, line 22
def check_box(method, options = {}, checked_value = "1", unchecked_value = "0")
  add_validate_attr!(self.object, method, options)
  super
end
collection_select(method, collection, value_method, text_method, options = {}, html_options = {}) click to toggle source
Calls superclass method
# File lib/judge/form_builder.rb, line 32
def collection_select(method, collection, value_method, text_method, options = {}, html_options = {})
  add_validate_attr!(self.object, method, options, html_options)
  super
end
grouped_collection_select(method, collection, group_method, group_label_method, option_key_method, option_value_method, options = {}, html_options = {}) click to toggle source
Calls superclass method
# File lib/judge/form_builder.rb, line 37
def grouped_collection_select(method, collection, group_method, group_label_method, option_key_method, option_value_method, options = {}, html_options = {})
  add_validate_attr!(self.object, method, options, html_options)
  super
end
radio_button(method, tag_value, options = {}) click to toggle source
Calls superclass method
# File lib/judge/form_builder.rb, line 17
def radio_button(method, tag_value, options = {})
  add_validate_attr!(self.object, method, options)
  super
end
select(method, choices, options = {}, html_options = {}) click to toggle source
Calls superclass method
# File lib/judge/form_builder.rb, line 27
def select(method, choices, options = {}, html_options = {})
  add_validate_attr!(self.object, method, options, html_options)
  super
end
time_zone_select(method, priority_zones = nil, options = {}, html_options = {}) click to toggle source
Calls superclass method
# File lib/judge/form_builder.rb, line 52
def time_zone_select(method, priority_zones = nil, options = {}, html_options = {})
  add_validate_attr!(self.object, method, options, html_options)
  super
end

Private Instance Methods

add_validate_attr!(object, method, options, html_options = nil) click to toggle source
# File lib/judge/form_builder.rb, line 59
def add_validate_attr!(object, method, options, html_options = nil)
  options_to_merge = html_options || options
  if options.delete(:validate)
    options_to_merge.merge! attrs_for(object, method)
  end
end