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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:50:48+00:00 2026-06-11T02:50:48+00:00

Error: SyntaxError in UsersController#index /home/ubuntu/ruby/users/app/controllers/users_controller.rb:7: syntax error, unexpected ‘:’, expecting ‘}’ format.json{render json: UsersDatatable.new(view_context)}

  • 0

Error:

SyntaxError in UsersController#index
 /home/ubuntu/ruby/users/app/controllers/users_controller.rb:7: syntax error, unexpected ':', expecting '}'
      format.json{render json: UsersDatatable.new(view_context)}
                              ^

I am trying to get dataTables plugin to work with my rails application (railcast #340). I have poured over and over and have no clue where this error might be coming from. It does not look like it’s any different from the code listed in http://railscasts.com/episodes/340-datatables?view=asciicast (except that I changed the name from Products to Users everywhere. I have completely hit a wall. My code seems to be identical in all but the name, and yet it doesn’t work! (it worked before I tried to start setting up the AJAX part)

EDIT:
Originally I used 1.8.7 and rails (3.2.7), but then upgraded to ruby 1.9.3, so not sure why I am still getting that error

  • 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-11T02:50:49+00:00Added an answer on June 11, 2026 at 2:50 am

    If you’re using ruby 1.8.7 then the syntax json: ... will not work.

    This should work instead (as @Jérôme Boé pointed out)

    format.json { render :json => UsersDatatable.new(view_context) }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Getting the following error: SyntaxError in FriendsController#index /Users/nelsonkeating/Desktop/ReminDeal/app/controllers/friends_controller.rb:32: syntax error, unexpected keyword_end, expecting ')'
In running this on index.html, I get the following error: Uncaught SyntaxError: Unexpected token
This is the error: Parse error: syntax error, unexpected '}' in /home/idghosti/public_html/testground/mma/include/footer.php on line
I'm getting an error [Exception: SyntaxError: Unexpected token :] when I try to evaluate
My Jquery code is recieving following error: Uncaught SyntaxError: Unexpected token ; Here is
The following gives me the error Uncaught SyntaxError: Unexpected identifier : $('span.xtro').html(''); $('span.xtro').html('<input type='button'
Parse error: syntax error, unexpected '?' error points to after .css : echo '<fb:recommendations
i'm getting this error: Parse error: syntax error, unexpected T_PRINT, expecting T_STRING in /homepages/26/d94605010/htdocs/lz/writecodeonline.com/php/index.php(190)
I keep getting this error: SyntaxError: Unexpected token o For a v.simple piece of
I'm writing an app in node.js and recently i had an unexpected error on

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.