RailsCasts Pro episodes are now free!

Learn more or hide this

Gerhardk's Profile

GitHub User: Gerhardk

Comments by Gerhardk


Hey Ryan I am follower of railscasts it has helped me out of trouble and understanding the way things work thanks alot. The new layout looks awesome.

I have a bit of a problem with coffiescript:
My gem file:

gem 'rails', '3.1.1'

platforms :jruby do
  gem "activerecord-jdbc-adapter", "~> 1.2.0"
  gem "jdbc-mysql", "~> 5.1.13"
  #gem "jruby-openssl"

platforms :ruby do
  gem 'activerecord-sqlserver-adapter'
  gem 'ruby-odbc'
group :assets do
  gem 'sass-rails',   '~> 3.1.4'
  gem 'coffee-rails', '~> 3.1.1'
  gem 'uglifier', '>= 1.0.3'

#### Styling
gem 'jquery-rails'
gem "haml-rails", "~> 0.3.4"
gem "haml", "~> 3.1.3"
gem "inherited_resources"
gem "formtastic", "~> 1.2.4"

In the application layout:

  = javascript_include_tag  "application"

In my application.js:

  //= require jquery
  //= require jquery_ujs
  //= require_tree .

In my games.js.coffie:

# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
alert "I knew it!"

My application runs but as soon as I go to the browser I get the following error:
unexpected token at '"ok","\n alert(\"I knew it!\");\n"]

If I take out the //= require_tree . the application works.
Can you help me if you want more info on the application here is the link to it https://github.com/Gerhardk/Battleships its a game which I am writing to get the feel of the new Rails 3.1.1 way of doing things

Thanks Gerhard