Completed 406 Not Acceptable in 26.0ms while trying to respond json

17 views
Skip to first unread message

Chandra Sekhar

unread,
Apr 11, 2015, 7:24:17 PM4/11/15
to rubyonra...@googlegroups.com
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/.

Colin Law

unread,
Apr 12, 2015, 4:16:29 AM4/12/15
to rubyonra...@googlegroups.com
On 12 April 2015 at 00:23, Chandra Sekhar <li...@ruby-forum.com> wrote:
> 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

Copy/paste here the section of development.log leading to the error.

Colin
Reply all
Reply to author
Forward
0 new messages