josevalim/rails-footnotes — pull request #110 by ideasasylum (2014-05-27 16:56:54+00:00)
Title: Allow the prefix to be a lambda — any interest?

This allows us to modify the filename name before generating the link — essential when using a VM for development. For example, I run all my code in a Vagrant VM so the filenames all start with `/vagrant` but I do all my editing in the native OS X with Sublime, so I need to modify the filenames before generating the links.

With this PR, we can have lambdas as the prefix so in my initialiser I can put:

```ruby
f.prefix = ->(*args) do
filename = args[0].sub '/vagrant', '/Users/jamie/projects/cognito'
"subl://open?url=file://#{filename}&line=#{args[1]}&column=#{args[2]}"
end
```