Sometimes I’ll open up a partial view file in my Rails project using Sublime Text 2 and want to know where its call(s) to render come from (usually to debug my way through views that call partials that call partials…). Is there a package that enables you to find a list of calling files (or just directly open the calling file if there’s only one), in the same vein as the “Switch between code and test” hotkey in Sublime Text 2 Ruby Tests?
Sometimes I’ll open up a partial view file in my Rails project using Sublime
Share
Your rails log is probably your best bet. When you’re trying to figure out which code called what, your rails log will say something like
Processing SomeController#some_action ..., which tells you which action was processed.After that it will also say things like,
Rendering template...with the name of the template.I guess what I’m saying is that I don’t think there’s a plugin that will work other than simply using a find with regex that finds all instances of
render, but even it’s going to probably miss which partials are included, etc.I would debug from what the log says that rails is actually doing – that’s going to be the only sure-fire source of truth, I think, and it will always include enough information to find out the answer to, “What just happened?”