开发者

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?

  1. Write the tests for a given action.
  2. Make sure they all pass.
  3. Start cleaning up the code.
  4. Repeat from 1 for every action you want to cleanup.

With autotest it will be a matter of minutes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜