我开始使用rails和devise并且在通过railscast而不是rails generate devise:views
我做了rails generate devise views
这导致了一些令我头疼的事情 - 我想要撤消不幸的是$ rails destroy devise views
会产生错误,所以我真的不知道如何回滚:
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.9/lib/active_support/inflector/methods.rb:124:in
block in constantize': uninitialized constant View (NameError) from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.9/lib/active_support/inflector/methods.rb:123:in
each' 从/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.9/lib/active_support/inflector/methods.rb:123:inconstantize' from /usr/local/lib/ruby/gems/1.9.1/gems/devise-1.5.1/lib/devise/mapping.rb:80:in
到' 来自/usr/local/lib/ruby/gems/1.9.1/gems/devise-1.5.1/lib/devise/mapping.rb:75:inmodules' from /usr/local/lib/ruby/gems/1.9.1/gems/devise-1.5.1/lib/devise/mapping.rb:92:in
routes' 来自/usr/local/lib/ruby/gems/1.9.1/gems/devise-1.5.1/lib/devise/mapping.rb:159:indefault_used_route' from /usr/local/lib/ruby/gems/1.9.1/gems/devise-1.5.1/lib/devise/mapping.rb:69:in
initialize' 来自/usr/local/lib/ruby/gems/1.9.1/gems/devise-1.5.1/lib/devise.rb:291:innew' from /usr/local/lib/ruby/gems/1.9.1/gems/devise-1.5.1/lib/devise.rb:291:in
add_mapping' 来自/usr/local/lib/ruby/gems/1.9.1/gems/devise -
任何想法我怎么能回来?
答案 0 :(得分:10)
rails destroy devise views
- 方便地撤销generate
答案 1 :(得分:5)
sintaxis错了,你只需要这个:
rails destroy devise:views
如果你想破坏特定的一组视图,请使用:
rails destroy devise:views model
而不是模型使用您要销毁的模型的名称,例如 user 或 admin ,无论您的模型是什么。
答案 2 :(得分:4)
只需删除views/devise
文件夹即可。
答案 3 :(得分:0)
只需删除routes.rb文件中的“rails destroy devise views”
即可