You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mac Sequoia, Rails 8, ruby 3.3.5, gem carrierwave version 3.07, sqlite
When serialize :avatars, JSON in Post model.
rails c:
post = Post.last
raises `class:Post': wrong number of arguments (given 2, expected 1) (ArgumentError)
ChatGpt advices to comment this line for Rails 8.
Err gone and
rails c:
post = Post.last
files = [
File.open(Rails.root.join('storage', 'Carolyn1.jpg'))
]
post.avatars = files
post.save!
post.avatars.map(&:url) #["/uploads/post/avatars/9/Carolyn1.jpg"]
But when get /posts
I see prefix and suffix around the file and img can't be shown
The text was updated successfully, but these errors were encountered:
Mac Sequoia, Rails 8, ruby 3.3.5, gem carrierwave version 3.07, sqlite
When serialize :avatars, JSON in Post model.
rails c:
post = Post.last
raises `class:Post': wrong number of arguments (given 2, expected 1) (ArgumentError)
ChatGpt advices to comment this line for Rails 8.
Err gone and
rails c:
post = Post.last
files = [
File.open(Rails.root.join('storage', 'Carolyn1.jpg'))
]
post.avatars = files
post.save!
post.avatars.map(&:url) #["/uploads/post/avatars/9/Carolyn1.jpg"]
But when get /posts
I see prefix and suffix around the file and img can't be shown
The text was updated successfully, but these errors were encountered: