Class: Rearview::UrlHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/rearview/url_helper.rb

Class Method Summary collapse

Class Method Details

.job_url(job) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/rearview/url_helper.rb', line 3

def self.job_url(job)
  dashboard_id = if job.dashboard.root?
                  job.app_id
                 else
                  job.dashboard.parent.id
                 end
  [ Rails.application.routes.url_helpers.rearview_url(Rearview.config.default_url_options),
    "#dash",
    "#{dashboard_id}",
    "expand",
    "#{job.id}" ].join("/")
end