0

Im trying to add jquery.validate.min.js to my rails application. I have copied the file to

vendor/assets/javascripts

Added it to application.js

//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require jquery.validate.min
//= require turbolinks
//= require_tree .
//= require bootstrap.min
//= require jquery.ddslick

And my application.html.erb has

<%= javascript_include_tag "vendor/jquery.validate.min" %>

But i get a 404 error for the jquery.validate.min.js

What did do wrong ?

Jepzen
  • 2,942
  • 6
  • 40
  • 62
  • Can you try something like the accepted answer in this question.[http://stackoverflow.com/questions/9006823/rails-asset-pipeline-standard-way-for-including-all-vendor-assets-javascripts](http://stackoverflow.com/questions/9006823/rails-asset-pipeline-standard-way-for-including-all-vendor-assets-javascripts) – Swati Yamgar Jan 07 '16 at 08:42

1 Answers1

0

If are using application.js you don't need to call this in layouts

<%= javascript_include_tag "vendor/jquery.validate.min" %>

But you need to have

<%= javascript_include_tag 'application' %>

If you want to manually load the jquery.validate.min then you need to add it to the precompile list

Add `Rails.application.config.assets.precompile += %w( jquery.validate.min.js )` to `config/initializers/assets.rb` and restart your server

Hope that helps

Rajesh Sharma
  • 419
  • 2
  • 5