RubyRedGrapefruit
RubyRedGrapefruit

Reputation: 12214

Why am I getting a Rails 3.2 jQuery Coffeescript syntax error

I have a controller called "organizations" with views.

I am trying to make a table in one of my views into a jQuery dataTable. I have done this a thousand times before this Coffeescript stuff.

I am running in dev mode, so I have no need to precompile my assets.

My application.js looks like this:

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

And my organizations.js.coffee looks like this:

jQuery ->
  $.("#organizations").dataTable()

I am getting a syntax error on the open paren. What is my problem? This should be a simple task.

Thanks for any help you can offer!

Upvotes: 1

Views: 297

Answers (1)

ksol
ksol

Reputation: 12235

I'm not sure what you're trying to achieve here, but shouldn't $.("#organizations") be $("#organizations") ? (without the dot)

Upvotes: 3

Related Questions