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

  • Home
  • SEARCH
  • 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 7876391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:09:35+00:00 2026-06-03T03:09:35+00:00

So CoffeeScript has shipped with Rails since 3.1? Fantastic! I’m getting into the syntax.

  • 0

So CoffeeScript has shipped with Rails since 3.1? Fantastic! I’m getting into the syntax. I like simplicity.

And yet, I can’t seem to figure out how to include it on my site. I’ve tried including it between and that didn’t work.

I have one .erb file I want this to be in, new.html.erb (obviously, this is a Rails app):

<script type="text/coffeescript">
# Countdown to date script provided by JavaScriptKit.com
# http://www.javascriptkit.com/script/script2/count.shtml

montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

countdown(yr,m,d) ->
  today=new Date()
  todayy=today.getYear()

if (todayy < 1000)
  todayy+=1900
  todaym=today.getMonth()
  todayd=today.getDate()
  todaystring=montharray[todaym]+" "+todayd+", "+todayy
  futurestring=montharray[m-1]+" "+d+", "+yr

  difference=(Math.round((Date.parse(futurestring)-Date.parse(todaystring))/(24*60*60*1000))*1)

if (difference==0) and document.write(current)
  elseif (difference>0) document.write("ONLY "+difference+" DAYS LEFT!")

countdown(2012,4,30)

</script>​

And it doesn’t show up at all. Ideas?

  • 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-03T03:09:36+00:00Added an answer on June 3, 2026 at 3:09 am

    If you have CoffeeScript enabled, Rails will generate a .js.coffee file for each of your controllers in app/assets/javascripts. That’s where your CoffeeScript belongs, and you don’t need to include script tags.

    Read more in the guide: http://guides.rubyonrails.org/asset_pipeline.html

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

Sidebar

Related Questions

I'm new to CoffeeScript, and I seem to be having trouble with the syntax
I am working in CoffeeScript (writing a Cakefile). I would like to compile some
How can I rewrite this code to coffeescript: $('.delete_action').click(function(event) { $.get('/delete_action?name=' + event.target.name +
Is there any intrinsic support for namespacing in coffeescript? Adequate namespacing seems like something
Coffeescript looks pretty cool. Has anyone used it? What are its Pros & Cons?
Here is a snippet of my jQuery code written in Coffeescript for a Rails
I'm working through Trevor Burnham's CoffeeScript book and I've run into a weird puzzle
The rails 3.1 has as default a great gem named uglifier for js minification.
I have seen coffescript tutorials that show how to use coffeescript with rails, nodejs,
Hey, I am Just Learning CoffeeScript and I Keep getting Errors. Here is my

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.