tags:

views:

39

answers:

2

I want to include the distance_of_time_in_words method in a sinatra app

I don't want to package and distribute a gem, which is what the Sintra docs direct you to do. I just want that method accessible in my view.

What's the easiest way to do this? Thanks.

+3  A: 

On http://www.sinatrarb.com/intro.html look at Helpers section and define helper methods for use in route handlers and templates

Shtirlic
A: 

Just place the file somewhere in your ruby load path ($LOAD_PATH) and require it. Or place the code directly in your app file.

Konstantin Haase