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 6920365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:08:14+00:00 2026-05-27T10:08:14+00:00

I have a problem with Rails and Jquery. Im using AJAX to add comments

  • 0

I have a problem with Rails and Jquery. Im using AJAX to add comments to articles without reloading them. The following code got automatically included in my views/application.html:

  <%= javascript_include_tag "application" %>
  <%= javascript_include_tag :all %>
  <%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" %>
  <%= javascript_include_tag  "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" %>

Everything seemed to work fine, until i realised that the server console shows the following error:

ActionController::RoutingError (No route matches [GET] "assets/all.js")

So since this line doesn’t seem to add anything to the application other than an error i deleted it. Next time I started the server and used the application all of a sudden every comment gets posted twice!? Otherwise everything still worked fine. So I added the deleted line again and I have no idea why but when I add the line

<%= javascript_include_tag :all %>

again everythings works fine again, only one comment gets posted as intended. However I dont want to keep this in the code since it throws an error. Can someone explain this behaviour and tell me how to fix this?

  • 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-05-27T10:08:15+00:00Added an answer on May 27, 2026 at 10:08 am

    Rails 3.1 uses sprockets to bundle javascript and css files. This makes the :all option deprecated. Sprockets use ‘magical’ comments to manage which javascripts are included.

    So your application.js should look something like this:

    //= require jquery
    //= require jquery_ujs
    //= require jquery-ui
    //= require_tree .
    

    The first line also includes jQuery itself, so you don’t need the other script tags. All you need to to is to point to application.

    <%= javascript_include_tag "application" %>
    

    If you’re deploying to production, you’ll need to run rake assets:precompile.

    There is a Railscasts episode on assets, which is a must see.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm experiencing a very strange problem with Rails and ajax using jQuery (although I
I am using jQuery and Ruby On Rails. I have an ajax call $.get()
Hey Guys. I have got a problem on using the jquery auto-complete plugin.my problem
I am using Jruby and rails 2.2.2. My problem is I have a migration
I am using jQuery in my Rails application. I wanted to add a expand
I have a Rails application and I'm using jQuery to query my search view
I am using the jquery ui date range picker for rails 3.1. I have
I am using the jQuery Form Plugin with my Rails app. I have a
I'm using Rails with the JQuery plugin, and have some really complicated validations for
I have a problem using devise with an AJAX login. I'm using the :remote

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.