Greetings Rails and Javascript Gurus!
I have a project where I am returning a large javascript file in a
respond_to do |format|
format.js
end
block.
I am trying to figure out how I can minify or compress the .js response since the .js.erb view is full of comments and varies in size based on the results from the controller.
Anyone have any ideas?
For Rails 4:
render js: Uglifier.new.compile(render_to_string)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With