ActiveModel :: MissingAttributeError (can't write unknown attribute 〇〇) in Rails

It is a memorandum Please let me know if you make a mistake

ActiveModel::MissingAttributeError (can't write unknown attribute `image`):

Error that image column cannot be written

Cause

Is the type for the form different?

Migration file

t.string :image

Form input screen

<%= f.file_field :image, class: 'input-box_image_file',value: "#{@tweet.image}"%>

Fix

Try changing the type

t.text :image

This solved the error!

Recommended Posts

ActiveModel :: MissingAttributeError (can't write unknown attribute 〇〇) in Rails
can't write unknown attribute `category_id` solved story
[Rails] How to write in Japanese
[Rails] Various ways to write in seed files
Group_by in Rails
[Ruby on Rails] How to write enum in Japanese
Write beautiful code with indentation in mind (rails, html)
How to write a date comparison search in Rails
Do not write 〇〇 logic in Rails View (* added later)