I successfully deployed my app to Site5 - and as I started to play around on it, I realized that not all of the jQuery was working. Specifically, anything that involved grabbing information from Ruby Forms. I'm getting the following error:
Uncaught TypeError: Object [object Object] has no method 'live'
Uncaught TypeError: Object [object Object] has no method 'live'
(anonymous function)
(anonymous function)
ut.extend.globalEval
ut.fn.extend.domManip
ut.fn.extend.replaceWith
(anonymous function)
ut.event.dispatch
y.handle
The script is as followed, and worked locally, on heroku, and on hostmonster so I'm confused as to why it is not working now.
In the document:
<%= form_for :team_design, :url => {:controller => "team_designs", :action => 'create'} do |f| %>
<%= f.label :style %> <%= f.select :style, [["Mens", "Mens"], ["Womens", "Womens"]], :include_blank=>'Select Style' %>
...
$(document).ready(function() {
$('#target_div select#team_design_style').live('change', function () {
var suitStyle = $(this).val();
switch (suitStyle) {
//all the different case possibilities
});
});
In Application.js:
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require_tree .
In my layout file
<head>
<title>scrubbed</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
In my Gemfile, under assets
group :assets do
gem 'execjs'
gem 'therubyracer', :platforms => :ruby
gem 'johnson'
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'jquery-rails'
gem 'uglifier', '>= 1.0.3'
end
Under Sources in Google Chrome:
/*!
* jQuery JavaScript Library v1.9.1
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2013-2-4
*/
* Sizzle CSS Selector Engine
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://sizzlejs.com/
*/
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.effect.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.position.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */