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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:22:36+00:00 2026-05-22T16:22:36+00:00

I have views in my application that reference my application.js file which contains functions

  • 0

I have views in my application that reference my application.js file which contains functions I use throughout my application.

I just installed the Rails 3.1 release candidate after having used the edge version of 3.1. Until I installed the RC I wasn’t having any problems but now I’m getting this error:

ReferenceError: Can’t find variable: indicator_tag

indicator_tag is a function I defined in application.js.
The only difference I notice in the javascript file is that now all my functions are wrapped in:

(function() { ... }).call(this);

I understand this is for variable scoping? But could it be preventing my pages from using those variables? And before anyone asks, I’ve made sure the javascript paths are correct in my include tags.

  • 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-22T16:22:37+00:00Added an answer on May 22, 2026 at 4:22 pm

    By default, every CoffeeScript file is compiled down into a closure. You cannot interact with functions from a different file, unless you export them to a global variable. I’d recommend doing something like this:

    On top of every coffeescript file, add a line like

    window.Application ||= {}
    

    This will ensure that there’s a global named Application present at all times.

    Now, for every function that you’ll have the need to call from another file, define them as

    Application.indicator_tag = (el) ->
      ...
    

    and call them using

    Application.indicator_tag(params)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Delphi 7 application that has two views of a document (e.g.
I have an application, built using MVC, that produces a view which delivers summary
I have a PartialViewModel in my MVC application that contains the following set up:
I have multiple views that come and go as the application runs. I want
I have an MVC application view that is generating quite a large HTML table
I have a java application that is connected to a view on a remote
I have a plug-in to an Eclipse RCP application that has a view. After
In my WPF application I have a View that is given a ViewModel, and
In an iPhone application I'm developing I have a Image View that displays eyes
I have a combobox in a view that receives information about application state changes,

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.