similar to: Application Helper and Javascript

Displaying 20 results from an estimated 3000 matches similar to: "Application Helper and Javascript"

2006 Feb 14
4
Escaping the AJAX View
I have a login form, in which I use a "form_remote_tag". I''m redirecting users to this form when they fail authentication as well... and using the "jumpto" method of capturing they original URL they requested via request.parameters, and redirecting to this URL after they authenticate. Problem is, if I try to do a "redirect_to", this won''t work, as
2006 Jan 25
9
AJAX Search w/database results
Hey, I have a main page that lists a table of Devices, along with a Search box. I''d like to have the Search field pull up any related Devices, and then re-populate the table. I can do this without AJAX, just calling my List action over again, passing the params to search on, but with AJAX I get the error, "Cannot convert nil to string" on this line: @device_pages, @devices =
2006 Jan 12
3
url_for in tests
Hi there, I''ve added an extra bunch of testing features for doing in-browser testing with Selenium, and am having quite a time figuring out how to use url_for with having a controller object present. I''ve tried using ActionController::Base.url_for and ActionView::Helpers::UrlHelper.url_for but haven''t been able to get something that works. What I want to be able
2006 Jan 25
2
Using ''GET''-method in Forms
Hi all, I''m using a selection-list / dropdown-list to choose an element in a number of grouped elements. Is there a way of passing an element_id to the form AND using the HTTP-''get''-method? I found that the <% start_tag %> has a :method-switch as an option, but it passes the arguments on like "/controller/action/?action=1". I would need something like
2006 Mar 03
6
has_one :next - invalid name?
I have this in a model: has_one :next, :class_name=>''WorkPart'', :foreign_key=>''next_id'' And it causes this error: compile error /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/deprecated_associations.rb:83: void value expression
2006 Feb 17
4
Best practice for showing errors AND updating list
Morning/Afternoon/Evening All, This is my first post to the ruby message board so if my request is better suited to another location just let me know, The problem I keep coming up against is with a listing of objects and updating that list via AJAX (for arguments we are talking about a list of users). As it stands I can currently submit a form, and update the list (using :update
2006 Jan 25
8
conditional replacements in rhtml
I am working on the Agile programming tutorial and trying out some ruby code. Can someone tell me why the following works: <h1>Display Cart</h1> <p> Your cart currently holds <%= @items.size %> <%= @items.size == 1 ? "item" : "items" %>. </p> while this does not? <h1>Display Cart</h1> <p> Your cart currently
2006 Mar 07
3
STI and unit testing
Hi all, I''m having a bit of a problem with unit testing. I''ve simplified my models to try and get my head round it but I''m still struggling. I''m using STI and trying to write tests for the extended models (code below). I''ve written test cases for the extended models which themselves extend the test case for the parent model, so BarTest extends
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
2007 Oct 27
1
Edge Javascript caching just not working
For some reason, in production, with this one line of code: javascript_include_tag :all, :cache => true I get this: <script cached="true" src="/javascripts/prototype.js?1193454472" type="text/javascript"></script> <script cached="true" src="/javascripts/effects.js?1193454472" type="text/javascript"></script>
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
2013 May 29
2
Why can't get remote javascript libraries on Rails 4
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! -- You
2006 Jan 04
4
Multiple emails from one SMTP connection?
Hi all. I''m running a nightly job that is creating a CSV file and sending to member via SMTP. I got the following error after about 20 emails or so: Net::SMTPServerBusy Too many connections from IP... Is there a way (using ActionMailer) to open a connection and send multiple emails. Or could I make sure the connection is closed before opening another? The only other option is to send
2006 May 12
1
Problem in including javascript files
Hi, I am using this <%= javascript_include_tag ''/editor/xyz.js'' %> to include javascript source to my code. But I am getting this as output <script src="/editor/xyz.js?" type="text/javascript"></script> I just want to know why I am getting a question mark in "/editor/xyz.js?". Thanks for any assistance in advance. Regards
2006 Jan 14
14
Javascript/AJAX Debugging
Hello ! I''m trying to implement something similar to the "multiple updates" section of the Web2.0 chapter of the Agile book. I implemented my version, and nothing is happening. No javascript errors, my logs look fine, page is rendered fine... just no Effect.Highlight. Here is the code: views/causes/cause_home/index.rhtml =============== <%= form_remote_tag(:complete =>
2010 Jul 12
1
newbie: what is preferred approach for including javascript files?
Hi, What is the cost of not cacheing javascript? If that cost is serious, do I prefer to selectively include javascript files only for view where they are needed? In other words I see four options: 1) Cache everything in layouts/application.html.erb and don''t worry about selective inclusion of .js files where they are needed; 2) cache some things in (e.g., dependencies like jquery) and
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 =>
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
2012 Jun 28
2
Best practice on Javascript and rails
Hi, I get constantly nervy whenever trying to implement any javascript / jquery in rails, basically because I''m not sure where to put things in the project! I know the people at rails have thought long and hard about how to best structure an app, so I''d like to learn the correct way. I''m using rails 3.2, ruby 1.9.3 ///////////// 1st situation - using a gem to include