class ActionView::Helpers::FormBuilder

Public Instance Methods

full_errors(attribute, options={}) click to toggle source
# File lib/action_view/helpers/form_builder.rb, line 39
def full_errors(attribute, options={})
  @template.render(
    :partial => "/outpost/shared/full_errors",
    :locals  => {
      :f            => self,
      :attribute    => attribute,
      :options      => options
    })
end
has_many_fields(association) click to toggle source
# File lib/action_view/helpers/form_builder.rb, line 69
def has_many_fields(association)
  partial = association.to_s.singularize
  fields  = String.new

  self.object.send(association).each do |obj|
    fields << self.simple_fields_for(association, obj) do |nf|
      nf.render_fields(partial)
    end
  end

  fields.html_safe
end
render_fields(partial, options={}) click to toggle source
# File lib/action_view/helpers/form_builder.rb, line 27
def render_fields(partial, options={})
  @template.render(
    :partial => "/outpost/shared/fields/#{partial}_fields",
    :locals  => {
      :f       => self,
      :index   => self.object.object_id,
      :options => options
    })
end
section(partial, options={}, &block) click to toggle source
# File lib/action_view/helpers/form_builder.rb, line 14
def section(partial, options={}, &block)
  @template.render(
    :partial => "/outpost/shared/sections/#{partial}",
    :locals  => {
      :f       => self,
      :record  => self.object,
      :options => options,
      :extra   => block_given? ? @template.capture(&block) : ""
    })
end