0.0
No commit activity in last 3 years
No release in over 3 years
This is a Rails plugin to see unused views in you controllers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 3.2
 Project Readme

UnusedView

This is a Rails plugin to see unused views in you controllers

Usage

In your Gemfile.

group :development do
  gem "unused_view"
end

and execute rake task unused_views.

# if you want to search unused views in path-to-rails-root/app/views
$ bundle exec rake unused_views
# if you want to search unused specific directory. e.g. path-to-rails-root/app/views/users
$ bundle exec rake 'unused_views[users]'
# Loading code in search of controllers
# Unused Views
/Users/toqoz/Projects/ppp/app/views/articles/edit.html.erb
/Users/toqoz/Projects/ppp/app/views/articles/new.html.erb
/Users/toqoz/Projects/ppp/app/views/users/create.html.erb
/Users/toqoz/Projects/ppp/app/views/users/edit.html.erb
/Users/toqoz/Projects/ppp/app/views/users/_form.html.erb
/Users/toqoz/Projects/ppp/app/views/shared/_header.html.erb

or start rails console and excute command.

$ bundle exec rails console
irb(main):001:0> show_unused_views
/Users/toqoz/Projects/ppp/app/views/articles/edit.html.erb
/Users/toqoz/Projects/ppp/app/views/articles/new.html.erb
/Users/toqoz/Projects/ppp/app/views/users/create.html.erb
/Users/toqoz/Projects/ppp/app/views/users/edit.html.erb
/Users/toqoz/Projects/ppp/app/views/users/_form.html.erb
/Users/toqoz/Projects/ppp/app/views/shared/_header.html.erb

# if you use pry-rails
[1] pry(main)> show-unused-views
/Users/toqoz/Projects/ppp/app/views/articles/edit.html.erb
/Users/toqoz/Projects/ppp/app/views/articles/new.html.erb
/Users/toqoz/Projects/ppp/app/views/users/create.html.erb
/Users/toqoz/Projects/ppp/app/views/users/edit.html.erb
/Users/toqoz/Projects/ppp/app/views/users/_form.html.erb
/Users/toqoz/Projects/ppp/app/views/shared/_header.html.erb

then see list of unused views.

Testing

$ cd path-to-unused-view
$ bundle install
$ rspec