Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Volt - using a variable in stylesheet_link argument (SOLVED)

I'm passing an assets_base_url variable to my view.

The following works for loading a stylesheet.

<link rel="stylesheet" href="{{ assets_base_url }}css/app.css">

However, I was wondering if it was possible to use that variable within the stylesheet_link method to output the entire tag. I tried it this way, but it doesn't work.

{{ stylesheet_link( assets_base_url . 'css/app.css') }}

edited Mar '14

To concat strings use '~'.

{{ stylesheet_link( assets_base_url ~ 'css/app.css') }}

Also you could use static urls (


Static urls! That's perfect. I can't believe I missed that when reading the docs.

Thanks bro!