1

I know it's related to assets, I do precompile the assets with

bundle exec rake assets:precompile

But the browser gives me 404 for only one javascript (jquery.formalize.min.js) file, which is not generated for some reason. There is however the code for jquery.formalize.min.js inside the precompiled application-xxxxxx.js.

I'm including it with:

<%= javascript_include_tag "formalize/jquery.formalize.min", "main" %>  

And the error message in Chrome looks like:

GET http://example.com/assets/jquery.formalize.min-724f21bf646762e539aa18c8db1d4d43.js 404 (Not Found)

Full path to the formalize js file is app/assets/formalize/jquery.formalize.min.js.

Of course, application.js is loading fine.

<%= javascript_include_tag "application", "main" %>

How do I load the formalize/jquery.formalize.min.js? Thanks.

valk
  • 9,363
  • 12
  • 59
  • 79
  • I also found the plugin for [formalize](https://github.com/iain/formalize-rails), but now i'm only curious what I did wrong. – valk Apr 16 '12 at 21:19

2 Answers2

1

Check your manifest file, which is app/assets/javascript/application.js by default. The //= entries control what files get pre-processed into the combined file.

Marlin Pierce
  • 9,931
  • 4
  • 30
  • 52
  • Thanks for the tip. I added the formalize in there. re-ran bundle exec rake assets:precompile, still problematic. I'm going to re-read the manual :) – valk Apr 16 '12 at 21:17
0

This was due to another fact, that Rails above v3 doesn't have somtething like:

config.assets.precompile += %w( *.js *.css )

See this issue for more.

Community
  • 1
  • 1
valk
  • 9,363
  • 12
  • 59
  • 79