Add functions to app.rb