8
votes

i am starting out with rails and devise and while going through the railscasts instead of doing rails generate devise:views i did rails generate devise views which is causing me a few headaches - i'd like to undo this unfortunately $ rails destroy devise views produces errors so i don't really know how to rollback:

/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:ineach' from /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:into' from /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:inroutes' from /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:ininitialize' from /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:inadd_mapping' from /usr/local/lib/ruby/gems/1.9.1/gems/devise-

any ideas how i can roll this back?

4
solved by going in and deleted the generated files manually - if there is a better way would love to hear ittoast

4 Answers

10
votes

rails destroy devise views - convenient reversal of generate

6
votes

the sintaxis is wrong, you just need this:

rails destroy devise:views

if you want to destroy an especific set of views use:

rails destroy devise:views model

instead of model use the name of the model you want to destroy, for example user, or admin whichever your model is.

5
votes

Just delete the views/devise folder.

0
votes

Just delete "rails destroy devise views" in your routes.rb file