Reputation: 28473
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.
Upvotes: 2
Views: 301
Reputation: 25964
Just place the file somewhere in your ruby load path ($LOAD_PATH
) and require it. Or place the code directly in your app file.
Upvotes: 0
Reputation: 692
On http://www.sinatrarb.com/intro.html look at Helpers section and define helper methods for use in route handlers and templates
Upvotes: 4