Question

I'm trying to create a simple application with ruby in rails. I've created this scaffold:

rails generate scaffold Pic title:string content:blob description:text

and when I try to migrate db with rake db:migrate I'm getting this error:

rake aborted!
An error has occurred, this and all later migrations canceled:

undefined method `blob' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0xb74f8ec4>

When I write say text instead of blob it works normally. So what's the problem with blob ?

Was it helpful?

Solution

The keyword is binary, not blob.

rails generate scaffold Pic title:string content:binary description:text

OTHER TIPS

There is no keyword blob in rails, you need binary.

rails generate scaffold Pic title:string content:binary description:text
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top