撤消rails会生成设计视图

时间:2011-11-24 12:39:54

标签: ruby-on-rails devise

我开始使用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:in constantize' 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:in modules' 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:in default_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:in new' 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 -

任何想法我怎么能回来?

4 个答案:

答案 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”

即可