Ask A Question

Notifications

You’re not receiving notifications from this thread.

Including Javascript and CSS Libraries With Rails Discussion

@chris. What do you think about Bower to manage all the front-end stuff?

Reply

+1 for Bower, it's actually pretty straightforward to introduce in a Rails app.

Reply

Bower is pretty great and I plan on doing an episode on integration with that in the future. This episode was designed mostly for explaining if you're using something obscure that has no gems or packages at all for it (including Bower packages).

Reply

Have you ever used https://rails-assets.org/ ?

Reply

Yeah I'll be doing a screencast for that in the future!

Reply

Chris - how did you add the JS to the delete button in your code?

I'm trying to use sweet-alert-confirm gem to show the new alerts on standard delete links but I can't get the alert to show.

Looks like you don't use the sweet-alert-confirm gem but you're getting the results I want. Can you show the code?

Reply

Great question! I answered this on your forum post: https://gorails.com/forum/h...

Reply

This is nice thank you Chris. Some external javascript libraries exist on the internet. What is better to have the JS file in your app or link to the js file via the internet? In this video you've downloaded it, but how would you add it to your rails app if you simply wanted to link to the js file via the internet? chrs

Reply

If you want to use an external JS file you can just include the script tag that points to it in your layout.

The reason why you would want these inside your Rails app is that they can be included and minified inside your code reducing the number of files the browser has to download. It's faster and more efficient for your users which makes it a good idea.

Reply

Nice! just a (silly) question: if the plugin - eg a slider - we want to use includes icons, like "pause", "play" or navigation buttons etc, then in this case need to add them on a vendor/images folder and set the paths (relative) on javascript properly to link to the icons and not seem broken, right?

Reply

I deeply miss the 4x player feature that is implemented in newer videos from Gorails. But 2x will do the work a little slower, but it's okay since we don't live in a perfect world anyway.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,464+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.