module FormGroups::GroupBuilder

Public Instance Methods

field(method, options = {}) click to toggle source
# File lib/form_groups/group_builder.rb, line 6
def field method, options = {}, &block
  raise ArgumentError, "Missing block" unless block_given?

  FieldTag.new(object_name, method, object, @template, self, options).render(&block)
end
id(method) click to toggle source
# File lib/form_groups/group_builder.rb, line 12
def id method
    @sanitized_id ||= object_name.to_s.gsub(/\]\[|[^-a-zA-Z0-9:.]/, "_").sub(/_$/, "")
end
objectify(options) click to toggle source
# File lib/form_groups/group_builder.rb, line 21
def objectify options
  options.merge(object: object)
end
value(method) click to toggle source
# File lib/form_groups/group_builder.rb, line 16
def value method
  object[method]
end