Find out whether a variable is used in a view in Ruby on Rails?
I have a very complex controller with a very complex set of views and partial views that I'm trying to clean up (not written by me originally).
In the controller, it开发者_JAVA百科 defines member variables, like:
@blah = "blah"
which I'm not sure if they are used in a view, or a partial view, or a partial view called by a partial view. Is there any way to find out?
Is there any way to find out?
- Write the tests for a given action.
- Make sure they all pass.
- Start cleaning up the code.
- Repeat from 1 for every action you want to cleanup.
With autotest it will be a matter of minutes.
精彩评论