i am trying to create an app with angular and rails.as a first step i am
trying my controller to give json response , in which i am failing with
the below error

Completed 406 Not Acceptable in 26.0ms

my controller-------

class TodosController < ApplicationController
  respond_to :json

  def index
    #respond_with :@todo
    @todo=Todo.all
    respond_to do |format|
      format.json { render :json => @todo}

  end
  end
  end

routes.rb------

resources :todos



gemfile--------

source 'https://rubygems.org'

gem 'rails', '3.2.17'
gem 'pry-nav'


# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'activerecord-jdbcsqlite3-adapter'
gem 'jruby-openssl'


group :development, :test do
  gem 'ffaker'
  gem 'factory_girl_rails'
  gem 'rspec-rails'
  gem 'shoulda'
  gem 'shoulda-matchers'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported
runtimes
  gem 'therubyrhino'

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/46066e34b70eb8305596ef5d2de1bb87%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to