Closed audionerd closed 13 years ago
I'm a little bit fuzzy on the change here. Can you cook up a patch for this? Will it work in both Rails 2.3.x and Rails 3?
Turns out my regex was pretty naive. It breaks *.html.mustache
routes!
I tried a few more regex patterns, but couldn't find anything that worked for both test.html.mustache
and namespace.module.js
.
Here's a patch (not a fix) that simply adds a test to illustrate the problem:
https://gist.github.com/758229
I think the solution is probably not in routing, but in processing later, probably in Jammit::Controller#parse_request
.
Taking a break now, but that's what I have so far.
Ok -- I'm going to leave this one as it is for the time being ... considering that *.html.mustache
-style routes are by far the most common. If you come up with a fix that works both ways, let me know.
I think it's impossible to tell, by definition -- how many of the dotted parts should be considered "extension", and how many should be considered to be "filename".
I wrote a very simple before filter around Jammit::Controller#parse_request
Here's an example for a filename called 'namespace.module.js': https://gist.github.com/803580
This allows me to specifically override Jammit routes by name, when needed.
It might be useful for Jammit to have a real before filter, or some way to specify route overrides case-by-case in assets.yml. But this little hack was enough for my project :)
I'd like to generate assets with filenames like:
But Jammit routes that request as:
... instead of
I was able to work around the issue by editing the route, adding this:
... and requests to "namespace.module.js" were fulfulled.