I attach the error screen [! [Enter image description here] [2]] [2]
I started working with rails yesterday, so I don’t really understand. Here is the model:
class Person < ApplicationRecord validates :name, presence: true validates :age, inclusion: { in: 17..65 }, presence: true, numericality: { only_integer: true } validates :datetime, presence: true has_attached_file :file, styles: { medium: "300x300>", thumb: "100x100>" } end Here is the migration:
class CreatePeople < ActiveRecord::Migration[5.0] def change create_table :people do |t| t.string :name, null:false t.integer :age, null:false t.datetime :datetime, null:false t.attachment :file t.timestamps end end end The string that is quarreling
@person = Person.new(page_params) And the procedure (page_params)
private def page_params params[:person].permit(:name, :age, :datetime, :file) end help me please
I tried to pull out the parameter in different ways, I rummaged through the entire Internet, but I can’t decide in any way! Here we take out the parameters:
private def page_params params[:person].permit(:name, :age, :datetime, :filek => [:tempfile, :original_filename, :content_type, :headers]) end Here is the error:

page_params, then in your migration. Then again inpage_params, then again in the migration. (Although in general it is necessary to look not at the migration, but at the base scheme, but these are the details, and there is no scheme in question) - D-side