Rails 3, make exception links clickable and open in editor (textmate)
I have a Rails 3 installation running on a remote development server. Is it possible to make the exception lines clickab开发者_开发知识库le and open in an editor like textmate on my local maschine? I would save a lot of time if I did not have to manually open textmate, find file and line number.
NoMethodError in Arts#index
Showing /home/demo1/app/widgets/art_widgets/list/display.html.erb where line #9 raised:
Best regards. Asbjørn Morell
Just found a great plugin that does exactly this! rails-stacktrace-textmate-linker-greasemonkey-script
Install greasemonkey from here: http://addons.mozilla.org/en-US/firefox/addon/748
Install rails-stacktrace-textmate-linker by clicking the link in the install section: https://github.com/ryankshaw/rails-stacktrace-textmate-linker-greasemonkey-script This will load the greasemonkey-script.
Go to Add-ons -> User Scripts -> Right click the Rails Stacktrace Linker and click edit.
Edit line 37 and 49. You will need to add the path to your rails Application.
... href='txmt://open?url=file:///Users/atmorell/Dropbox/MorellusWallace/", ...
Reload your application in firefox and enjoy nice clickable stacktrace that opens in textmate :)
WINNING!
Not in a simple way.
You'd need a software running in the background that would interpret the exception page to put links in it, and then open the software, file and find the line specified. As far as I know, there's no first-party solution.
I also wanted textmate link(txmt://) in Rails Error Page. But until now no success.
rails-footnotes has similar feature. It insert txmt link to every page. But not in Error page.
someone on rails-talk mailing list asked same question. and said merb had that feature.
Adding the rails footnotes gem will give you clickable file references in your application trace.
https://github.com/josevalim/rails-footnotes
I found this gem slowed my dev environment down a little so disabled it's main functionality, I only needed it purely for the clickable file references. You can do this by adding the following line in the .rails_footnotes file in the root of your app.
Footnotes::Filter.notes = []
精彩评论