Re: [Rails] Why can't get remote javascript libraries on Rails 4

21 views
Skip to first unread message

Hassan Schroeder

unread,
May 29, 2013, 5:48:49 PM5/29/13
to rubyonra...@googlegroups.com
On Wed, May 29, 2013 at 10:33 AM, Alberto Pat Martínez
<apmsu...@gmail.com> wrote:
> In rails 3, I included this line:
> <%= javascript_include_tag
> "http://cdn.leafletjs.com/leaflet-0.5.1/leaflet.js" %>
>
> But when migrate to rails 4, its not posible and I get the next error:
> Invalid argument -
> C:/Ruby193/findiner/app/assets/javascripts/http://cdn.leafletjs.com/leaflet-0.5.1

That usage is still in the docs, and I just tried it on a fresh test app
(Rails 4.0.0.rc1) without a problem.

Perhaps you could create a small test app that demonstrates this?
Or at least show the complete file where it occurs?

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

mike

unread,
May 29, 2013, 6:48:11 PM5/29/13
to rubyonra...@googlegroups.com


On Wednesday, May 29, 2013 1:33:31 PM UTC-4, Alberto Pat Martínez wrote:
In rails 3, I included this line:
<%= javascript_include_tag "http://cdn.leafletjs.com/leaflet-0.5.1/leaflet.js" %>

But when migrate to rails 4, its not posible and I get the next error:
Invalid argument - C:/Ruby193/findiner/app/assets/javascripts/http://cdn.leafletjs.com/leaflet-0.5.1

So far, I won't be able to get remote libraries. Thanks for help!

I'm not sure what this does, but I put your reference into the head section of one of my application layouts and it worked fine (no errors and when I inspect the app in a browser, the js file is being loaded without errors).  The only thing that's different is that I'm running ruby 2.0, rails 4.0.rc1. 
Reply all
Reply to author
Forward
0 new messages