ruby on rails - Why do I get "406 Not Acceptable" for this request? -


i'm trying json response in browser i'm getting:

completed 406 not acceptable in 4ms (activerecord: 1.0ms)

it should work. have following code in controller:

respond_to :json   def get_current_value   stocks = stockexchange.find(:all)    respond_with(stocks) |format|    format.json { render :json => stocks.to_json}   end  return end 

the best way force rails using json format in response add .json url you're requesting. once working, can try playing headers , such.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -