# Ltr stylesheets are missing

**URL:** https://meta.discourse.org/t/ltr-stylesheets-are-missing/29152
**Category:** Bug
**Created:** [May 22, 2015, 9:24pm UTC](https://meta.discourse.org/t/ltr-stylesheets-are-missing/29152 "2015-05-22T21:24:29Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [May 22, 2015, 9:24pm UTC](https://meta.discourse.org/t/ltr-stylesheets-are-missing/29152/1 "2015-05-22T21:24:29Z")

</div>

When I view the source on a Discourse forum that is not being served by a CDN, the stylesheet link tag points to a `/stylesheets/` directory. Where is that directory?

---

<div class="post-metadata">

### Author: ![Qasem\_h](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/qasem_h/32/155935_2.png) [@Qasem\_h](https://meta.discourse.org/u/Qasem_h)
#### Post date: [May 22, 2015, 9:31pm UTC](https://meta.discourse.org/t/ltr-stylesheets-are-missing/29152/2 "2015-05-22T21:31:28Z")

</div>

look this :

> **[Build software better, together](https://github.com/search?q=repo%3Adiscourse%2Fdiscourse+stylesheets)**
>
> GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.

```
globs = ["#{Rails.root}/app/assets/stylesheets/**/*.*css"]

```

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [May 22, 2015, 10:00pm UTC](https://meta.discourse.org/t/ltr-stylesheets-are-missing/29152/3 "2015-05-22T22:00:36Z")

</div>

I don’t think that’t it for the production stylesheets.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 22, 2015, 10:02pm UTC](https://meta.discourse.org/t/ltr-stylesheets-are-missing/29152/4 "2015-05-22T22:02:18Z")

</div>

its in tmp directory and stylesheet\_cache table

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [May 22, 2015, 10:04pm UTC](https://meta.discourse.org/t/ltr-stylesheets-are-missing/29152/5 "2015-05-22T22:04:15Z")

</div>

I’m asking because it’s not finding the \_rtl stylesheet, but the RTL stylsheet is in `tmp/stylesheet-cache/`

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 22, 2015, 11:09pm UTC](https://meta.discourse.org/t/ltr-stylesheets-are-missing/29152/6 "2015-05-22T23:09:40Z")

</div>

what version are you running, had some bugs I fixed yesterday.

upgrade to latest and be sure that assets:precompile runs.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [May 22, 2015, 11:22pm UTC](https://meta.discourse.org/t/ltr-stylesheets-are-missing/29152/7 "2015-05-22T23:22:47Z")

</div>

The latest version on the master branch. assets:precompile runs. The ltr and rtl versions of the stylesheets are all present in tmp/stylesheet-cache.

With a LTR language the stylesheet link tag is outputting this:  
`<link href="/stylesheets/desktop_0eb6bcb9ae52a6f7bcd2c532c6f8f020d1b7a01b.css?__ws=forum.bookswithwings.org" media="all" rel="stylesheet">`

This is finding the stylesheet.

With a RTL language the stylsheet link is:  
`<link href="/stylesheets/desktop_rtl_0eb6bcb9ae52a6f7bcd2c532c6f8f020d1b7a01b.css?__ws=forum.bookswithwings.org" media="all" rel="stylesheet">`

This is returning a status of 404. But the rtl file is present in `tmp/stylesheet-cache`

I also tried setting up a new installation of Discourse and got the same results.

When I apply the changes made in this PR to an older version of Discourse (when you were still accessing the stylesheets in the `uploads/stylesheet-cache` directory, everything works as expected.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 22, 2015, 11:42pm UTC](https://meta.discourse.org/t/ltr-stylesheets-are-missing/29152/8 "2015-05-22T23:42:15Z")

</div>

confirmed, repro here, will get it sorted

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 22, 2015, 11:44pm UTC](https://meta.discourse.org/t/ltr-stylesheets-are-missing/29152/9 "2015-05-22T23:44:38Z")

</div>

I bet it’s the underscore based splitting in the controller

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [May 22, 2015, 11:51pm UTC](https://meta.discourse.org/t/ltr-stylesheets-are-missing/29152/10 "2015-05-22T23:51:01Z")

</div>

I tried removing the underscore before ‘rtl’ and it still couldn’t find the rtl stylesheets, but I might have missed something when I did it.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [May 23, 2015, 12:25am UTC](https://meta.discourse.org/t/ltr-stylesheets-are-missing/29152/11 "2015-05-23T00:25:18Z")

</div>

Yeah, this seems to fix the problem.

# target,digest = params[:name].split(“\_”)

```
target = params[:name].rpartition("_").first
digest = params[:name].rpartition("_").last

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 23, 2015, 5:25am UTC](https://meta.discourse.org/t/ltr-stylesheets-are-missing/29152/12 "2015-05-23T05:25:55Z")

</div>

Pushed a fix

[https://github.com/discourse/discourse/commit/bcaed90744bf470504b883010f28c9f59bd33505](https://github.com/discourse/discourse/commit/bcaed90744bf470504b883010f28c9f59bd33505)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 23, 2015, 5:25am UTC](https://meta.discourse.org/t/ltr-stylesheets-are-missing/29152/13 "2015-05-23T05:25:57Z")

</div>


