Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8242299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:07:15+00:00 2026-06-07T21:07:15+00:00

So, I think this is maybe a problem with me being a JS newb

  • 0

So, I think this is maybe a problem with me being a JS newb and also a recent Rails upgrade. I’m trying to use Ryan Bates’ nested_form gem to create a complex dynamic nested form. The page loads ok and looks fine, but when I click the “add” and “remove” links, nothing happens. Hovering over the links gives me javascript:void(0). Using the JavaScript observer in Chrome, I get

Uncaught TypeError: Object #<HTMLDocument> has no method 'observe'

Some googling tells me that this means I’m having a conflict with Prototype, but I am not using Prototype (or anything but jQuery) anywhere in my application.

Here’s my guess at the relevant info. Please tell me if I’ve left anything out.

I’m using rails 3.2.4 rc 1 and ruby 1.9.3, on Ubuntu 12.04 LTS.

My gemfile:

source 'http://rubygems.org'
source 'http://gems.github.com'
gem 'rails', '3.2.4.rc1'

gem 'mysql'

gem 'execjs'

gem 'therubyracer'

gem 'nested_has_many_through'
gem 'validates_date_time'
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'therubyracer', :platform => :ruby
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails', '>= 1.0.12'
gem 'formtastic', :git => 'git://github.com/justinfrench/formtastic.git', :branch => '2.1-stable'
gem "nested_form", :git => 'git://github.com/ryanb/nested_form.git'

My tree from application.js

//= require jquery_ujs
//= require jquery
//= require jquery_nested_form
//= require_tree .

Contents of assets/javascripts:

application.js
nested_form.js
rails.js

There isn’t anything in public/javascripts.

Lastly, here’s what the console puts out during page load (it’s for the edit page of a Play, which has_many Acts–I’m trying to use nested_form to add and remove Acts)

[2012-07-15 08:10:28] INFO  WEBrick::HTTPServer#start: pid=23455 port=3000


Started GET "/acts/1/edit" for 127.0.0.1 at 2012-07-15 08:10:32 -0400
Processing by ActsController#edit as HTML
  Parameters: {"id"=>"1"}
  Act Load (3.5ms)  SELECT `acts`.* FROM `acts` WHERE `acts`.`id` = ? ORDER BY act_number LIMIT 1  [["id", "1"]]
  Play Load (0.7ms)  SELECT `plays`.* FROM `plays` WHERE `plays`.`id` = 1 LIMIT 1
  Scene Load (0.9ms)  SELECT `scenes`.* FROM `scenes` WHERE `scenes`.`act_id` = 1 ORDER BY scene_number
  Rendered acts/_scene_fields.erb (2.4ms)
  Rendered acts/_scene_fields.erb (1.0ms)
  Rendered acts/_scene_fields.erb (1.0ms)
  Rendered acts/_scene_fields.erb (1.0ms)
  Rendered acts/_scene_fields.erb (1.0ms)
  Rendered acts/_scene_fields.erb (1.0ms)
  Rendered acts/_scene_fields.erb (1.0ms)
  Rendered acts/_scene_fields.erb (1.0ms)
  Rendered acts/_scene_fields.erb (1.0ms)
  Rendered acts/_scene_fields.erb (1.0ms)
  Rendered acts/_scene_fields.erb (1.3ms)
  Rendered acts/edit.html.erb within layouts/application (317.0ms)
Completed 200 OK in 558ms (Views: 407.1ms | ActiveRecord: 12.7ms)
[2012-07-15 08:10:33] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true


Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2012-07-15 08:10:33 -0400
Served asset /jquery.js - 304 Not Modified (30ms)
[2012-07-15 08:10:33] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true


Started GET "/assets/formtastic_changes.css?body=1" for 127.0.0.1 at 2012-07-15 08:10:33 -0400
Served asset /formtastic_changes.css - 304 Not Modified (3ms)
[2012-07-15 08:10:33] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true


Started GET "/assets/formtastic.css?body=1" for 127.0.0.1 at 2012-07-15 08:10:33 -0400
Served asset /formtastic.css - 304 Not Modified (5ms)
[2012-07-15 08:10:33] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true


Started GET "/assets/nested_form.js?body=1" for 127.0.0.1 at 2012-07-15 08:10:33 -0400
Served asset /nested_form.js - 304 Not Modified (3ms)
[2012-07-15 08:10:33] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true


Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2012-07-15 08:10:33 -0400
Served asset /application.css - 304 Not Modified (9ms)
[2012-07-15 08:10:33] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true


Started GET "/assets/scaffold.css?body=1" for 127.0.0.1 at 2012-07-15 08:10:33 -0400
Served asset /scaffold.css - 304 Not Modified (3ms)
[2012-07-15 08:10:33] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true

I suspect there’s something I’m accidentally calling somewhere, or something…but I have no idea.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:07:18+00:00Added an answer on June 7, 2026 at 9:07 pm

    SUCCESS!

    I figured it out…but I still don’t quite understand why these answers are the right answers. Thank you all for your help and suggestions. It turned out that there were three things I had to do.

    1) @lest was correct that I needed to take nested_form.js out of my assets/javascripts folder.
    2) I had to switch from calling javascript_include_tag :defaults to javascript_include_tag ‘application’.
    3) I had to reorder my tree in application.js as follows (I previously had jquery and jquery_ujs swapped, at the recommendation of something I read elsewhere on stackoverflow):

    //= require jquery
    //= require jquery_ujs
    //= require jquery_nested_form
    //= require_tree .
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new at JavaScript so I think my problem may be simple. This
I think this question may end up being a bit subjective so I'm marking
I think this might be a problem with the theme I'm using ( Nitobe
First, I want to refer to this post, I think it's the same problem:
I hope I can explain this problem decently well! I'm trying to implement a
I think this may be relatively straight forward. I have a rewrite rule that
Maybe it is just a simple mistake but this thing is driving me crazy.
Hopefully this question isn't as subjective as I think it may be. I have
I think this is likely to be a generic .NET assembly loading question, but
I THINK this line is causing a 3.5K Byte memory leak, any ideas why?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.