Search code examples
ruby-on-railsasset-pipelinenested-formsrailscasts

Why isn't the asset pipeline loading for Railscasts #196 (Nested Model Form)?


I downloaded the code for Railscasts 196 (Nested Model Form) from the GitHub depository, executed the bundle command and migrated the database. Pages are loading as expected, but none of the dynamic links ('remove', 'Add Answer' or 'Add Question') are working. When I noticed that the on 'click' functions for the add_fields and remove_fields classes were not active:

  • I checked what assets were loaded in the browser via
    http://localhost:3000/assets/application.js and found that there
    wasn't any jQuery code loaded at all -- all that is displayed is the manifest file.
  • I checked the log file and Firebug console but didn't see any errors.
  • I checked the jquery-rails gem content with a bundle open jquery-rails and all of the code is accessible.

Does anyone know why the assets are not being loaded?


Solution

  • Bump your rails release to 3.2.22 (the latest rails 3.2.x release) and it'll fix your problem. You can bump this in your Gemfile:

     gem 'rails', '3.2.22'
    

    And than run bundle update to update dependencies.