def new
def new
@form = UserForm.new(User.new)
end
end
class User < ActiveRecord::Base
devise :database_authenticatable, :recoverable, :rememberable, :trackable
end
# Created by migration:
create_table "users", id: :serial, force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "first_name"
t.string "last_name"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
Expected behavior
A form view rendering - which works if I remove the Reform wrapper and just return the new user. I.e. @form = User.new works.
Actual behavior
I get a NoMethodError in the controller action (Not the view, no call to :name is made neither in the view nor in the model.
NoMethodError at /admin/users/new undefined method `name' for #<User:0x00007f9224de0d38>
System configuration
Reform version: 2.2.4
Started GET "/admin/users/new" for 127.0.0.1 at 2020-06-08 14:06:47 +0700
Processing by Admin::UsersController#new as HTML
User Load (1.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 1], ["LIMIT", 1]]
User Update (1.2ms) UPDATE "users" SET "last_seen_at" = $1 WHERE "users"."id" = $2 [["last_seen_at", "2020-06-08 07:06:51.049370"], ["id", 1]]
Completed 500 Internal Server Error in 73ms (ActiveRecord: 12.4ms)
NoMethodError - undefined method `name' for #<User:0x00007f922310cf68>:
app/controllers/admin/users_controller.rb:18:in `new'
Complete Description of Issue
My form is calling
#name
on it's model without (what I can see) reason?Expected behavior
A form view rendering - which works if I remove the Reform wrapper and just return the new user. I.e.
@form = User.new
works.Actual behavior
I get a NoMethodError in the controller action (Not the view, no call to :name is made neither in the view nor in the model.
System configuration
Reform version: 2.2.4