{"record":{"id":"6b87179f9ccb47f1","repo":"padrino/padrino-framework","slug":"formbuilder-object-must-be-present-if-there-s-no","errorCode":null,"errorMessage":"FormBuilder object must be present. If there's no object, use a symbol instead (i.e. :user)","messagePattern":"FormBuilder object must be present\\. If there's no object, use a symbol instead \\(i\\.e\\. :user\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"padrino-helpers/lib/padrino-helpers/form_builder/abstract_form_builder.rb","lineNumber":13,"sourceCode":"module Padrino\n  module Helpers\n    module FormBuilder\n      # Base class for Padrino Form Builder\n      class AbstractFormBuilder\n        attr_accessor :template, :object, :multipart\n        attr_reader :namespace, :is_nested, :parent_form, :nested_index, :attributes_name, :model_name\n\n        def initialize(template, object, options = {})\n          @template = template\n          raise 'FormBuilder template must be initialized' unless template\n          @object = object.is_a?(Symbol) ? build_object(object) : object\n          raise \"FormBuilder object must be present. If there's no object, use a symbol instead (i.e. :user)\" unless object\n          @options = options\n          @namespace = options[:namespace]\n          @model_name = options[:as] || Inflections.underscore(@object.class).tr('/', '_')\n          nested = options[:nested]\n          if (@is_nested = nested && (nested_parent = nested[:parent]) && nested_parent.respond_to?(:object))\n            @parent_form = nested_parent\n            @nested_index = nested[:index]\n            @attributes_name = \"#{nested[:association]}_attributes\"\n          end\n        end\n\n        def error_messages(*params)\n          @template.error_messages_for object, *params\n        end\n\n        def error_message_on(field, options = {})\n          @template.error_message_on object, field, options\n        end","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/padrino/padrino-framework/blob/167044f3d56b2bce12f943eb826fdb0b0ea94375/padrino-helpers/lib/padrino-helpers/form_builder/abstract_form_builder.rb#L1-L31","documentation":"Error \"FormBuilder object must be present. If there's no object, use a symbol instead (i.e. :user)\" thrown in padrino/padrino-framework.","triggerScenarios":"Thrown at padrino-helpers/lib/padrino-helpers/form_builder/abstract_form_builder.rb:13 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"167044f3d56b2bce12f943eb826fdb0b0ea94375","analyzedAt":"2026-08-23T12:41:41.049Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}