Implementation of url() helper in Passenger app


I’m working on developing a Passenger app using Python and Flask and am trying to port the layout.erb from the Sinatra example app to Python/Jinja2. In particular, I’m trying to understand where the url() helper is implemented, as in e.g.:

<link rel="stylesheet" type="text/css" href="<%= url("/bootstrap-3.3.7/css/bootstrap.min.css") %>">

Is this an OOD-specific Ruby function or does it come from a different third-party Ruby library? Apologies if this is common knowledge; I am not a web developer by trade or training.


Hi Nick.

the url function is a home-grown function to generate urls specific to ondemand.

Inside the code for the dashboard are several different definitions for the url function.

grep -sr 'def url' *

app/apps/dev_router.rb:  def url
app/apps/manifest.rb:  def url
app/apps/ood_app.rb:  def url
app/apps/sys_router.rb:  def url
app/apps/usr_router.rb:  def url
app/models/batch_connect/app.rb:      def url

I hope this helps.


Hi Gerald,

Sorry for the slow reply. Thank you, that is helpful.


No since you’re using Sinatra - that’s a sinatra function. We use Ruby on Rails a different Ruby web framework.

Looks like url is this function.

(they alias url to uri)

Thanks for the clarification! I changed this to the solution.