Sunder
Sunder

Reputation: 1513

serving static files with Ruby Espresso

I'm trying to serve some assets using the el gem but can't seem to get it to work. I've referred to another question posted here -- Assets in espresso breaks my app

My setup looks like this --

require 'e'
require 'el'
...

app = E.new(true){  
    assets_url '/pub', true
}

But hitting localhost:5252/pub/hello.txt (yes, this file exists) results in 404. What am I missing?

Upvotes: 0

Views: 58

Answers (1)

user904990
user904990

Reputation:

You missed to append any paths to Sprockets environment.

http://espresso.github.io/Periphery/Assets.html#sprockets

Please try:

app = E.new(true){  
  assets_url '/pub', true
  assets.append_path 'relative-path-to-static-files'
}

Upvotes: 1

Related Questions