padrino/padrino-framework · error
FormBuilder object must be present. If there's no object, us
Error message
FormBuilder object must be present. If there's no object, use a symbol instead (i.e. :user)
What it means
Error "FormBuilder object must be present. If there's no object, use a symbol instead (i.e. :user)" thrown in padrino/padrino-framework.
Source
Thrown at padrino-helpers/lib/padrino-helpers/form_builder/abstract_form_builder.rb:13
module Padrino
module Helpers
module FormBuilder
# Base class for Padrino Form Builder
class AbstractFormBuilder
attr_accessor :template, :object, :multipart
attr_reader :namespace, :is_nested, :parent_form, :nested_index, :attributes_name, :model_name
def initialize(template, object, options = {})
@template = template
raise 'FormBuilder template must be initialized' unless template
@object = object.is_a?(Symbol) ? build_object(object) : object
raise "FormBuilder object must be present. If there's no object, use a symbol instead (i.e. :user)" unless object
@options = options
@namespace = options[:namespace]
@model_name = options[:as] || Inflections.underscore(@object.class).tr('/', '_')
nested = options[:nested]
if (@is_nested = nested && (nested_parent = nested[:parent]) && nested_parent.respond_to?(:object))
@parent_form = nested_parent
@nested_index = nested[:index]
@attributes_name = "#{nested[:association]}_attributes"
end
end
def error_messages(*params)
@template.error_messages_for object, *params
end
def error_message_on(field, options = {})
@template.error_message_on object, field, options
endView on GitHub (pinned to 167044f3d5)
When it happens
Trigger: Thrown at padrino-helpers/lib/padrino-helpers/form_builder/abstract_form_builder.rb:13 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of padrino/padrino-framework@167044f3d5 (2026-08-23).
Data as JSON: /api/errors/6b87179f9ccb47f1.
Report an issue: GitHub.