I’m currently working on a fun project in Sinatra and I came across something that was an issue.
sinatra/base, you have to be sure to
set :static, true and
On to the code… I have two projects, each with their own app.rb and config.ru:
public folder for that extension.
The fix is quite simple and is applied to App 2’s app.rb file. Just add these two lines:
like so: app.rb
Now the extension will be able to see the public folder and pull files from it. In case you’re interested, the code in Sinatra that tests these two attributes is at approximately
line 1000, after the comment
# static files route, where it tests
pass unless options.static? && options.public?. I’m not sure if this is the desired behaviour or not and I have not found anything in the documentation about this. I plan on contacting the Sinatra authors though to find out, or to at least be sure that they put this up in their documentation.
In the meantime, I hope this helps.
Questions? E-mail me: this domain AT gmail DOT com