similar to: Stubbing #javascript_include_tag in a helper spec

Displaying 20 results from an estimated 2000 matches similar to: "Stubbing #javascript_include_tag in a helper spec"

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
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
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 this information? Isn''t part of the HTTP
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
2006 Jun 08
3
Back again; errors in depot app
Sorry, but this is a big one - after adding the Ajax portion of the Agile Web Development tutorial my page displays: Application error Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html It started when I added - page[:current_item].visual_effect :highlight, :startcolor => "#88ff88" , :endcolor =>
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.
2009 May 24
11
Class method not being stubbed
Hi guys. I''m setting an expectation on a class method. For some reason, the method isn''t being stubbed, and the expectation isn''t seeing the call. In KeywordListsController#create, I call the private method #create_keywords_and_associate, which calls AdSenseHeavenParser#parse . Thus, some of my specs set an expectation on AdSenseHeavenParser#parse . However, that
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
2009 Apr 09
4
uninitialized constant ActionView::Helpers::AssetTagHelper
Hi All, I just wiped out my hard drive, did a fresh install of os x 10.5, and upgraded to rails 2.3.2. i installed the mysql pkg for os x, and created the databases i needed for the project i was working on before the upgrade. However when i run rake db:migrate to run my migrations i get this error uninitialized constant ActionView::Helpers::AssetTagHelper I''ve found some stuff about
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.
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
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 "javascript_include_tag". I hardcoded the javascript that
2006 Aug 06
0
Best practice: installing plugin assets in rake task or install.rb?
I noticed that a few plugins come with rake tasks to install additional assets. In Rails 1.1.4 there''s a hook file, install.rb, that is run when after the plugin has been installed (edge Rails has uninstall.rb, too). Wouldn''t it be nicer to use this (these) hooks to install (remove) plugin specific files automatically? Preferrably existing (different) files are overwritten
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/.
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 I''ve changed my list of
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"></script> But when trying
2010 Jun 02
1
Ajax with JQuery
I have used Ajax link and live validation in index.rhtml Ajax link requires JavaScript "prototype" and live validation requires "jquery". i got "element.dispatchEvent is not a function" on the firebug console when i used "prototype" and "jquery" in same page index.rhtml after i removed javascript "prototype" library, i got "Ajax is
2012 Aug 29
7
custom js in rails project
Hello, I have a rails project with one controller and one action, as simple as posible. And I''m trying to put some custom 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 =>
2008 Oct 28
7
How to override one method of AssetTagHelper
I created a file ./lib/action_view/helpers/asset_tag_helper.rb and put in it only the method I want to override. like this module ActionView module Helpers #:nodoc: module AssetTagHelper def image_path(source) compute_public_path(source, ''images'') end end end end But as soon I try this all the others methods from the overriden module are not
2006 Jul 25
1
Battle of Namings: stylesheet_link_tag vs link_to_javascript
Link helper namings counterintuitive in an environment where convention over configuration prevails: <%= link_to_javascript ''myscript'' %> <%= stylesheet_link_tag ''mystyle'' %> A simple def in ActionView::Helpers::AssetTagHelper would fix things in a nice, backward-compatible way, such that: <%= link_to_javascript