我像往常一样生成了一个脚手架:
rails g scaffold Job description:text user_id:integer finished:boolean
rake db:migrate
但在那之后,引导布局生成器似乎正在尝试使用 couchrest_model :
/Users/cblair/.rvm/gems/ruby-1.9.3-p125/gems/couchrest_model-1.1.2/lib/couchrest/model/base.rb:82:in `method_missing': undefined method `columns' for Job:Class (NoMethodError)
from /Users/cblair/.rvm/gems/ruby-1.9.3-p125/gems/twitter-bootstrap-rails-2.2.0/lib/generators/bootstrap/themed/themed_generator.rb:87:in `block in retrieve_columns'
from /Users/cblair/.rvm/gems/ruby-1.9.3-p125/gems/twitter-bootstrap-rails-2.2.0/lib/generators/bootstrap/themed/themed_generator.rb:101:in `rescue_block'
from /Users/cblair/.rvm/gems/ruby-1.9.3-p125/gems/twitter-bootstrap-rails-2.2.0/lib/generators/bootstrap/themed/themed_generator.rb:86:in `retrieve_columns'
from /Users/cblair/.rvm/gems/ruby-1.9.3-p125/gems/twitter-bootstrap-rails-2.2.0/lib/generators/bootstrap/themed/themed_generator.rb:58:in `columns'
我用沙发来装东西,但不是 Active Record。(我基本上在其中调用了一些 GET 和 POST 方法)。
我的第一个问题是,如何设置默认的 ORM,以便引导生成器可能会接受它?我也试过这个:
rails g bootstrap:themed Jobs fluid --orm=active_record
〜但我得到同样的错误,似乎忽略它。