15

Background: I wish to use freebase suggest in my app.

I intend to add an autocomplete to the #location input using coffeescript:

$ ->
  $("#location").suggest type: "location"

Which will be included by the asset pipeline at require_tree in my application.js file:

//= require jquery
//= require jquery_ujs
//= require modernizr
//= require_tree .

Must I copy suggest.min.js to app/assets/javascripts and require it as

//= require suggest.min

or can I require it directly from its publicly available url?

New Alexandria
  • 6,951
  • 4
  • 57
  • 77
Alec Wenzowski
  • 3,878
  • 3
  • 25
  • 40

1 Answers1

23

You can always get it from the CDN by putting it in a view or template.

<%= javascript_include_tag "http://freebaselibs.com/static/suggest/1.3/suggest.min.js" %>
Brad Mace
  • 27,194
  • 17
  • 102
  • 148
cmpolis
  • 3,051
  • 21
  • 19