Git Product home page Git Product logo

Comments (7)

kalasjocke avatar kalasjocke commented on June 30, 2024

Sounds like a great idea. Do you have the chance to try it out and create a pull request?

from sinatra-asset-pipeline.

kalasjocke avatar kalasjocke commented on June 30, 2024

However, after giving it some more thought it only raises an exception in the development environment as all assets are served via the default Sinatra public folder in production. Do you still think we need the if statement?

from sinatra-asset-pipeline.

conrad-vanl avatar conrad-vanl commented on June 30, 2024

It's a very minor detail that I only noticed because I was migrating an app from rake-pipeline to this and some of our previous urls were displaying this error instead of 404'ing (or something else to tell me that the asset didn't exist). It took me a while to figure out that I had a path mis-configured.

With using sprockets-helpers you shouldn't ever be able to generate a URL to an asset that doesn't exist, so in theory it wouldn't matter too much. Only use case I could come up with is if an implementer needed their sinatra app to handle certain urls that began with "/assets" ... maybe like if they wanted to use sinatra to dynamically serve a user profile photo - "/assets/user/:id" or something. If it means anything, I think Sprocket's built-in rack middleware passes if it comes across an asset that doesn't exist, but I could be wrong.

If you think it's relevant enough to issue a PR I'll do so and test it out.

from sinatra-asset-pipeline.

kalasjocke avatar kalasjocke commented on June 30, 2024

Got it, I would love a pull request!

from sinatra-asset-pipeline.

kalasjocke avatar kalasjocke commented on June 30, 2024

Closing this issue, please reopen it if you find the time to make a pull request.

from sinatra-asset-pipeline.

plukevdh avatar plukevdh commented on June 30, 2024

I think this could still be useful, even if it were just a more explicit error message, saying which asset it was trying to find.

from sinatra-asset-pipeline.

kalasjocke avatar kalasjocke commented on June 30, 2024

I agree, a friend of mine using this library just ran into the same problem the other day, so I think that we should reopen this, do some work and get this feature in.

from sinatra-asset-pipeline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.