lucasefe / themes_for_rails

Theme Support for Rails 3
This very same page :)
MIT License
308 stars 102 forks source link

javascript_path cannot get files with dotted names #44

Closed spleenteo closed 12 years ago

spleenteo commented 12 years ago

problem using javascript path in Rails 3.1 (never got this problem before)

I know that current_theme_javascript_path('jquery.tools.min') returns the path to a file named query.tools.min.js

In fact, the output html seems to be fine

but misteriously the browser returns this error "NetworkError: 404 Not Found - http://localhost:3000/themes/current_theme/javascripts/jquery.tools.min.js"

btw, if I remove the dots from the filename renaming it, it works perfectly current_theme_javascript_path('jquery_tools_min')

I tryed to watch to your code... sorry, I'm a front end developer! :) Any ideas?

lucasefe commented 12 years ago

When you say:

I know that current_theme_javascript_path('jquery.tools.min') returns the path to a file named query.tools.min.js

You mean:

I know that current_theme_javascript_path('jquery.tools.min') returns the path to a file named "jquery.query.tools.min.js", right?

BTW, try using the github version. It got rewritten, and with that version, the error doesn't manifest itself.

Keep me posted, please.

spleenteo commented 12 years ago

I dont't really understand the phrase you wrote.... If I write "jquery.min" as parameter to the function, it used to returns the full path "path/to/javascripts/jquery.min.js" and not "path/to/javascripts/jquery.jquery.min.js" Am I missing something??

Anyway I'm using the GitHub version; I saw you made some commit in these days, I'm going to try if this new update solve the problem.

I'll keep you informed. Thx a lot for your great job

Tigraine commented 12 years ago

I have the same issue with the 0.4.3 and with the latest git version.

The link generator helpers (current_theme_javascript_path work perfectly. The issue is that rails won't deliver any files with dots in them.

So like:

/themes/<themename>/javascripts/foo.bar.js is not being served and results in a 404 but /themes/<themename>/javascripts/foo_bar.js works.

For now I am renaming my javascripts but this needs fixing.. Any help I can give you there?

codesource commented 11 years ago

Same as Tigraine, I have the same issue with latest git version.

The problem comes from "AssetsController" on function "find_themed_asset". This function do:

I fixed this function:
Line 32:

I added this condition to make sure that path's extension is not different to request's extension.

I hope it will help people.