Icaro Icaro - 1 month ago 11
jQuery Question

How to put Jquery minified in Rails4 with jquery-rails gem?

i'am trying to create a super lightweight page with rails, and the jquery-rails gem wont put the minify version of jquery on final js file.

i've tryed to change my

application.js
to have
//=requry jquery.min
and other variations but nothing work.

this is my final js after compile (with jquery not minifyed):

/*!
* jQuery JavaScript Library v1.11.2
* http://jquery.com/
*
* Includes Sizzle
...
"function"!=typeof Object.create&&(Object.create=function(t){function e(){}...

Answer

Actually the Jquery is minified the problem is the Jquery is not minified by uglyfier, the Jquery-rails gem source is already minified but have a simple header commented wich causes some tools like the PageSpeedInsights won't recognize as minified.

so i've made this mistake sorry about that.