Search code examples
rubydashing

Get dashboard name using Dahing ruby framework


I'm using dashing to create some dashboards, but now I want to create for example 2 dashboards, basic job code is the same, only source differs, is there a way get name of the dashboard.

I've tried request.request_uri, but I'm getting exception that such variable does not exists.

Is there a way, maybe there is a way to pass that value throe dashboards files?


Solution

  • I've had good luck doing something like this by leveraging the file variable.

    For instance:

    env = File.basename(__FILE__, File.extname(__FILE__)) 
    

    That'll give you the dashboard name in the env variable.