Displaying 20 results from an estimated 231 matches for "javascript_include_tag".
2008 Oct 31
2
Stubbing #javascript_include_tag in a helper spec
When writing specs for a helper method, how do you set an expectation
for #javascript_include_tag ?
describe NeighbourhoodsHelper do
describe ''#initialise_map'' do
it ''should include the "foo" JS file'' do
# expectation here
helper.foobar
end
end
end
I''ve tried replacing "# expectation here" with the...
2006 Jan 25
3
Application Helper and Javascript
I have a "javascript_include_tag" including a Javascript function.
I have a function being invoked via a helper in the same view, which prints
out a script tag that uses the javascript function above.
Problem is, the function being invoked via the helper can''t find the
javascript function included in the "javas...
2011 Aug 10
3
javascript_include_tag error
<!DOCTYPE html>
<html>
<head>
<title><%= @title %></title>
<%= csrf_meta_tag %>
<%= javascript_include_tag
"http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js",
"jquery.rails.js"
%>
<script type="text/javascript">
...app/views/layouts/application.html.erb:7: syntax error, unexpected
'','', expecting '')''
...bs/jqu...
2008 Feb 01
0
javascript_include_tag and controller actions
Hello folks,
I''d like to include the javascript generated by an RJS file in an
RHTML file using the <script></script> tags. I was going to use
javascript_include_tag to do this, mostly in order to ensure that the
contents are not cached by the browser.
Unfortunately, javascript_include_tag appends a ".js" to the file name
if there is not a period in the file name. This means that I cannot
do
<%= javascript_include_tag ''/browse/read_va...
2007 Oct 11
2
relative_url_root and javascript_include_tag
Hi. In my environment.rb, I have:
ActionController::AbstractRequest.relative_url_root = "/foobar"
In my layout, I have:
<%= javascript_include_tag :defaults %>
Question 1:
I am getting an error:
ActionController::RoutingError (no route found to match
"/javascripts/prototype.js" with {:method=>:get}):
When I remove the relative_url_root, everything works great. What
gives?
Question 2:
What is the javascript file I want t...
2006 Dec 11
3
javascript_include_tag -- time stamp
Using, for example,
<%= javascript_include_tag ''prototype'' %>
results in
<script src="/javascripts/prototype.js?1164912447"
type="text/javascript"></script>
I take it the number 1164912447 is the timestamp of the file (in seconds
since the epoch)
Isn''t it redundant to include thi...
2012 Aug 29
7
custom js in rails project
...css and js to my
own index.html.erb (not public/index.html.erb), I inluded this on the
layout file:
layout file:
<!DOCTYPE html>
<html>
<head>
<title>Volei</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag ''foundation.min.js'' %>
<%= javascript_include_tag ''app.js'' %>
<%= javascript_include_tag ''jquery.foundation.navigation.js'' %>
<%= javascript_include_tag ''modernizr.foundation.js'' %>
<%= javas...
2011 Oct 12
4
How to access controller's instance variable in a js.erb loaded by javascript_include_tag?
Hello!
In rails 3.1 app I have a controller UsersController with ''show'' action.
show.html.erb contains:
<% content_for(:head) do %>
<%= javascript_include_tag ''myscript'' %>
<% end %>
<p>Hello @user.name</p>
And I have this in myscript.js.erb
$jQuery(document).ready(function() {
alert(<%= @user.name %>);
});
@user is being assigned by a controller and it works just ok in
show.html.erb, but in myscript.js.er...
2010 Jul 12
1
newbie: what is preferred approach for including javascript files?
...include javascript in the views it is needed;
4) cache nothing and include everything in layouts/
application.html.erb.
I cobbled together javascript functionality in development mode, such
that my layouts/application.html.erb file came to look like this:
<html>
<head>
...
<%= javascript_include_tag :defaults, "jquery-1.4.2.js", :cache=>true
%> <!-- using prototype & jquery -->
<%= javascript_include_tag
"jquery.maskedinput-1.2.2.js", :cache=>true %>
<%= javascript_include_tag "autoNumeric-1.5.1.js", :cache=>true %>
<%= java...
2010 Jun 02
1
Ajax with JQuery
...;jquery" in same page index.rhtml
after i removed javascript "prototype" library, i got "Ajax is not
defined" on the firebug console when i clicking ajax link.
how can i use both ajax and jquery in the same page?
Can anybody give me a solution for this?
For example:
<%=javascript_include_tag "prototype"%>
<%=javascript_include_tag "jquery"%>
<%= javascript_include_tag ''livevalidation/jquery.validate'' %>
<%= javascript_include_tag ''livevalidation/jquery.validation.functions''
%>
<%= stylesheet_link_tag '&...
2007 Oct 05
9
Rearchitect the new :cache feature of javascript_include_tag, similar to ToolbawksPacker
I have done some work with the javascript and stylesheet helpers for
ToolbawksPacker..
http://svn.toolbawks.com/toolbawks_packer/trunk/
Which more/less takes all executed javascript_include_tags and
stylesheet_link_tag on any converged view (combines all partials and such)
and builds a list of js and css files respectively and uses that to form a
cache. In additon, it also minifies the JS using JSMin and uses a basic
minification technique initiated by AssetPackager (
http://synthesis.sbe...
2007 Jan 04
0
javascript_include_tag emits self-closing <script> tag
hello,
here is a sample rhtml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><%= javascript_include_tag :defaults %></head>
<body>test</body>
</html>
the call to javascript_include_tag outputs self-closing <script />
tags. which is not a proper strict xhtml according to the DTD, so IE
does not render the page. the page is just shown blank.
is there a way to make r...
2006 Mar 21
13
Double and single quote usage in AWDWR
Hello everyone!
I''ve noticed, that the book uses double quotes almost everywhere. It is like
<%= javascript_include_tag "prototype" %>
I''ve checked the "programming ruby, 2ed" book and found that double
quotes are most suited when escape sequences and substitutions are
required. Isn''t it more semantically correct to write this code like
<%= javascript_include_tag '...
2009 Feb 10
0
javascript_include_tag -- 500 internal server error
Hi,
I''m trying to use (in my view/layout) javascript_include_tag and it
generates something like:
<script type="text/javascript"
src="http://apps.facebook.com/fbml_static_get.php?src=%2Fcanvas_name%2Fjavascripts%2Ffacebooker.js%3F1234225416&appid=my_app_id&pv=1&sig=995d0e338609600ecbc28c3caf156f29&filetype=js"></sc...
2006 Jan 28
2
javascripts
Trying to use auto_complete_for which works fine on my home system.
I see that when I use <%= javascript_include_tag "defaults" %>
that when used, the webrick reports
GET /javascripts/prototype.js
GET /javascripts/dragdrop.js
GET /javascripts/effects.js
GET /javascripts/controls.js
but on the system that I am trying to develop on and doing similarly,
the webrick only reports
GET /javascripts/defau...
2008 Jun 02
0
stylesheet_link_tag, javascript_include_tag, caching problems
So, the new caching for stylesheet_link_tag, javascript_include_tag
which rolls up the files into one all.js or all.css files is great ...
however I''ve run into an issue:
If all.cs or all.js don''t exist, they get generated ... great, I''ve
reduced the number of gets ...
The problem is what occurs when the files already exist ... even if...
2009 Sep 01
0
Problem with "javascript_include_tag :all" tag.
Hello Friends,
I m using auto_complete pluging for text_field.
When using "javascript_include_tag :all" tag pagination is not working
..
Anybody tell me what''s happen here ???
Thanx.
--
Posted via http://www.ruby-forum.com/.
2006 Jan 18
4
That ol'' AJAX select box update again : observe_field does nothing
...g/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>The Manias Project</title>
<%= stylesheet_link_tag "manias", :media => "all" %>
<%= javascript_include_tag "dojo" %>
<%= javascript_include_tag "prototype" %>
</head>
The result is that the breakpoint in the controller is never called - so
observe_field is doing nothing
Kind Regards,
Eric
2006 Mar 17
4
using ajax and layouts
Hi.
I copied the layout-example from agile web dev. in rails. When I want
to use ajax to create a search field including
<head><%= javascript_include_tag "prototype" %></head>
does''nt work when I include the line in my
app/views/layout/demo.rhtml. Name of controller is demo_controller.rb.
The search-field is in app/views/demo/observer.rthml and I have to
include the above mentioned line in this file to "ajax-enable...
2007 Aug 09
3
javascript_include_tag - release number instead of time stamp
I''ve noticed that the major part of my pages'' load time is the
Javascript for prototype and effects. Instead of forcing a reload per
request (by attaching the ?timestamp parameter), I''d like to force
reload this per release.
Right now, I load the CSS and JS manually (without the Rails helpers)
and just append a release number manually. It''s OK, but when I