2

I'm trying to install this JQuery Plugin: http://coverflowjs.github.io/coverflow/tutorial/get-started/

I'm relatively new to rails, and not sure how to implement a JQuery plugin without a Gem. (And not comfortable trying to create a gem at this point)

Can someone please assist in laying out a step-by-step breakdown of how they would go about installing this plugin?

Really appreciate any help.

dgreen22
  • 388
  • 4
  • 19

4 Answers4

2

Follow below steps:

  1. Download latest jquery file using link https://code.jquery.com/jquery-3.1.1.min.js

  2. Add file under /assets/javascript folder

OR

Add below code under app/views/layouts/application.html.erb

<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
puneet18
  • 4,341
  • 2
  • 21
  • 27
2

You should use rails-assets.org, which wraps bower components into ruby gems on the fly. Find the equivalent library in bower and then use the gem it creates.

Coverflow is available at https://rails-assets.org/#/components/coverflow

chris raethke
  • 425
  • 3
  • 8
0

You just try this..

You can download the plugin and save it in vendor/assets/javascripts. Then you include it on application.js

//In (for example) application.js

//= require jquery

or in some added file like

<%= javascript_include_tag 'jquery' %>
Karthick Nagarajan
  • 1,327
  • 2
  • 15
  • 27
0

You can do these steps as below:

  1. download coverflowjs library and put it inside app/assets/javascripts/ or you can put it inside vendor/assets/javascripts/
  2. in your file application.js, you only put this line.

    //= require coverflowjs

Khanh Pham
  • 2,848
  • 2
  • 28
  • 36
  • I tried this and got this error `couldn't find file 'coverflowjs' with type 'application/javascript'` I downloaded the file and put the entire unzipped coverflow folder into `vendor/assets/javascripts/` Is that correct or am I suppose to take out specific files and insert it into that folder? Thanks for the help. – dgreen22 Jan 11 '17 at 05:17
  • no, you just put file with extension `js` inside `javascripts` folder. if you have some files such as `.css` or `.png`,....With extension `.css`, you must put it inside `assets/stylesheets/` – Khanh Pham Jan 11 '17 at 09:24