As others have mentioned you need a users/show.json view, but there are options to consider for the templating language...
ERB
Works out of the box. Great for HTML, but you'll quickly find it's awful for JSON.
Good solution. Have to add a dependency and learn its DSL.
Same deal as RABL: Good solution. Have to add a dependency and learn its DSL.
Plain Ruby
Ruby is awesome at generating JSON and there's nothing new to learn as you can call to_json
on a Hash or an AR object. Simply register the .rb extension for templates (in an initializer):
ActionView::Template.register_template_handler(:rb, :source.to_proc)
Then create the view users/show.json.rb:
@user.to_json
For more info on this approach see http://railscasts.com/episodes/379-template-handlers