What is the best way to keep javascript libraries up to date in rails?

I am currently developing a Rails application that heavily uses some javascript libraries, including jquery, backbone.js and d3.js. For jQuery there is a jquery-rails gem , for the basics, backbone-rails . But nothing of the kind exists for d3.js.

I copied javascript from d3.js to my repository, but it is a little dirty for me, because when d3 is updated, I have to copy it again (and I should notice that d3 got the update!). I was thinking of git submodules, but I have to pull them out manually every time I browse the repository. Maybe there is a way to let the provider check for a specific version of the d3 repository?

How do you handle updating third-party javascript libraries in rails? Is there a preferred way?

+5
source share
2 answers

Why not create a pearl of d3-rails if it is not? Now, the convention seems to be to put these javascript libraries in their own gems using jquery-rails, which are now included in Rails 3.1. Now it works more, but it may pay you back in the future. You would help the community, and that would facilitate updates in your application.

+5
source

Not sure why you got this offer ...

, , . - ; , .

. " " JS, , - , - . , jQuery attr() prop() .

, :

  • , , , .
  • , - , , , - .

, !

+7

All Articles