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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:38:35+00:00 2026-06-07T05:38:35+00:00

I just finished Code School’s intro course on JQuery, jQuery Air: First Flight .

  • 0

I just finished Code School’s intro course on JQuery, jQuery Air: First Flight. It was a great way to learn the basics of jQuery and when I was done I was all excited about adding some jQuery to my new little rails 3.2 app. How to make that happen isn’t obvious, though.

By default, rails 3.2 comes with the jquery-rails and coffee-rails gems. New 3.2 apps are all set up accept javascript and jquery in the form of coffee-script. While I’ll learn coffee-script soon, right now all I’ve got is jquery.

More specifically, should I add something like:

<script type="text/javasript" src= "https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

into the head of my app/views/layouts/application.html.erb file or is all that taken care of jquery-rails gem and the

<%= javascript_include_tag "application" %>

already there?

Where in my app do I put the jQuery code? With every new controller I generate, rails 3.2 creates a nice [new_controller].js.coffee file in the app/assets/javascripts/ directory. Javascript doesn’t work if I put it in that .coffee file. Anyone have any thoughts?

  • 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-07T05:38:36+00:00Added an answer on June 7, 2026 at 5:38 am

    Having experimented around and corresponded with the good folks at Code School, I’ve come up with the following answer with others may find useful:

    Rails 3.2 apps are ready made to accept coffeescript. Indeed, every new controller automatically generates a [new_controller].js.coffee file ready to accept one’s new coffeescript. While I’ll get to coffeescript soon enough, having just finished JQuery Air: First Flight, all I know is jQuery.

    Here’s what one needs to do to add jQuery to one’s Rails 3.2 app with
    default, asset pipeline settings:

    1) Place javascript_include_tag(:application) in the
    app/views/layouts/application.html.erb file. Code School’s Adam Fortuna notes that it is typical to put that line in the footer which sounds like good advice. That probably allows the rest of the page to load before the javascript.

    2) In the ‘app/assets/javascripts/’ directory create a new file with the
    suffix .js which in my case was user.js. Note: Do not name your jQuery
    file the same as the automatically created .js.coffee file or it will not
    be read, probably because the coffeescript file alone will be.

    3) Add your jQuery javascript to that file to your heart’s content! It’s already part of your 3.2 app, included with the jquery-rails gem.

    If others have insight into using jquery and javascript instead of coffee-script in a rails 3.2 app, please add. That said, my next step is to learn coffee-script!

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

Sidebar

Related Questions

Just finished up my first mvc4 app. Everything is working great until I deploy
I just finished an intro to web dev course in my CS program and
I've just finished a functional piece of code and would like to upload it
I just recently finished Michael Feathers' book Working Effectively with Legacy Code . It
I just finished creating my first major application in C#/Silverlight. In the end the
I just finished reading the Functions chapter from Uncle Bob's Clean Code . The
Just finished my code to use the default Media Player from Android, pretty pleased
I just finished my C# console application code for a project and would like
I've just finished converting a large amount of legacy code to use NHibernate. The
I have just finished some code that is successfully filtering deadlines that fall between

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.