6
Khi tôi cố gắng làm điều này trong Sinatra,lỗi xảy ra khi tôi cố gắng "tất cả" phương pháp trong DataMapper
class Comment include DataMapper::Resource property :id, Serial property :body, Text property :created_at, DateTime end get '/show' do comment = Comment.all @comment.each do |comment| "#{comment.body}" end end
Nó trả về lỗi này,
ERROR: undefined method `bytesize' for #<Comment:0x13a2248>
bất cứ ai có thể chỉ cho tôi đi đúng hướng ?
Cảm ơn,