jrails

"rescue in const_missing" error with Ruby 1.9.1, Rails 2.3.2, and jrails 0.4

I recently started a project where the team decided we'd like to use jQuery rather than Prototype/Scriptaculous for our javascript needs. We set our project up, and began the switch. The plugin was installed via these instructions, and all went according to plan. Shortly after, when trying to run "./script/server", we get the followin...

jRails with autocomplete helpers

I've just started new branch of my project, where I try to use jRails. As far everything works awesome, except the autocomplete (especially text_field_with_auto_complete). What would be the best solution to make autocomplete working again? implement whole autocomplete by myself (I don't really like this one) rewrite the old prototype h...

Load jQuery through Google API in Rails using HAML?

This feels like it should be pretty simple, but not much seems to be loading. I have this in my app/views/layouts/application.html.haml: = javascript_include_tag 'http://www.google.com/jsapi' %script{ :type => "text/javascript", :charset => "utf-8" } //<![CDATA[ google.load("jquery", "1.3.2"); google.load("jqueryui", "1.7.2"); ...

Ruby 1.9.1 and Jrails

I'm getting error: uninitialized constant ActionView::Helpers::JavaScriptElementProxy::ActionView I've tried forcing a reinstall of jrails which didn't fix the error, and Googling the error has yet to yeild a result. Any suggestions? Ruby 1.9.1, Rails 2.3.4. ...

jrails loading remote_form_tag rails

I recently switched to jQuery using jRails for an app. 99% of all my previous RJS seems to work perfectly, the only except is the :loading => callback when using the remote_form_tag. <% form_remote_tag :url => '/hostels/update_currency', :loading => visual_effect(:appear, :load_currency), :html => { :id => 'currency' } do %> I have ...

jrails autocomplete selection problems with DIVs or anything else

I just starting using jRails and the jRails auto_complete helper http://github.com/evilmarty/jrails_auto_complete I was using the default auto_complete helper before using prototype and the drop in worked fine with jRails except for hovering over the results of the autocomplete. If you use simple text for the result, it works as adver...

Warning: already initialized constant JAVASCRIPT_DEFAULT_SOURCES

I switched from prototype library to jquery with jrails plugin. After that I've got the warning: jrails.rb:17: warning: already initialized constant JAVASCRIPT_DEFAULT_SOURCES jrails.rb looks like: ActionView::Helpers::PrototypeHelper::JQUERY_VAR = 'jQuery' ActionView::Helpers::AssetTagHelper::JAVASCRIPT_DEFAULT_SOURCES = ['jquery.mi...

Rails ajax background requests

I have a remote_form which works 100% When a user clicks submit, it goes out grabs so data from the db or data scraped from another website, and updates the page seamlessly... The problem I'm having now, is that I'd like to do the same thing, but do it without having the user click the submit button with an onload event. I think I'm ...

Rails observe_field using jQuery

Is there an equivalent to the Rails/Prototype observe_field method using jQuery without jRails? I am doing a search-as-you-type with will_paginate: <%= observe_field('search', :frequency => 2, :update => 'results', :loading => "Element.show('spinner')", :comple...

Using JSON with jRails

I am currently trying to use AJAX in my application via jRails. I am trying to return a JSON object from my controller, and then parse it in my Javascript. I am using json2.js to do the parsing. Here is the code I currently have: function getSomething() { $.ajax({ type: "GET", url: "map/testjson", success: ...

jRails and select boxes

I have a drop-down box that I want to submit data, onchange. Previously I used: select_tag name, options_for_select(pairing_options, :selected => 'Y'), { :onchange => remote_function( :url => { :action => 'pair', :escape => 'false', :update_grid_item => update_p...

multiple visual effects on one event

I have a code that looks like this. <%= link_to_remote "View results", { :update=>"uxUpdateDiv" , :url=>{:controller=>"exam", :action=>"results"} , :loading=>visual_effect(:appear, "uxcLoader", :duration=> 0.1), :before =>visual_effect(:fade, "uxUpdateDiv", :duration => 0.1), :complete => visual_effect(:appear, "uxU...

Plugin/Gem to get Rails 3 style UJS in Rails 2.3.x?

I have a new application starting that's using Rails 2.3.8 for stability concerns and gem compatibility, however we'd like to begin being conscious of Unobtrusive JavaScript by implementing the Rails 3 style UJS in this application. Is there any existing plugin/gem that backports this feature? We are currently using the jrails gem to s...

Ruby on Rails jQuery Visual Effect

I am working on a search function on RoR that basically just has a cool visual effect when a user clicks the search button. Here is the code in my view for search.rhtml <html> <head> <title>Tutor</title> <%= javascript_include_tag :defaults %> </head> <body> <h1></h1> <%= form_remote_tag :url =>{ :action =>...

Multiple periodically_call_remote calls not behaving as expected

I've been doing ruby and rails for a long time but am a newbie when it comes to the more dynamic elements (currently jrails and jQuery), so it's entirely possible I'm missing something. That said, I've got a page where multiple elements need updating from multiple sources. For example, a dynamic header comes from one source and 5-6 d...

jrails_auto_complete setup help

I have been struggling to get a simple autocomplete working with my Rails app using the jQuery UI 'autocomplete' I'm already using jRails, so I tried using the jrails_auto_complete I set it up like it says in the README, but I get the following javascript error when I start typing in the box: Failed to load resource: the server respon...

Creating a nested remote_form within a regular form

I'm trying to create a nested remote_form within another non-remote form in one of my RoR apps. It looks likes this: form_for @event do |f| f.text_field :name remote_form_for @location do |d| d.text_field :address d.submit f.text_area :another f.submit end Of course it's more complicated than this, but...

is there a fork of jRails that works with Rails 2.3 and jQuery 1.4 ?

We're rewriting a site using Rails, and the old site makes extensive use of jQuery v1.4 in its templates. We'd like the old scripts to keep working, but we'd also like to use rails' javascript helpers for our own new scripts. jRails sounds like what we want, but it only seems to support jQuery 1.3. Is there a more up-to-date fork of j...