Hi
I am a newbie trying to make a webservice that talks JSON. I have this in my controller:
Hi
I am a newbie trying to make a webservice that talks JSON. I have this in my controller:
neigaard wrote:
Hi
I am a newbie trying to make a webservice that talks JSON. I have this in my controller:
---- class SchedulesController < ApplicationController def list @schedules = Schedules.all respond_to do |format| format.html # list.html.erb format.json { render :json => @schedules.to_json } end end end ----
I have nothing special in my routes, but should the default map.connect ':controller/:action/:id.:format' not handle this for me?
Thank you S�ren
Probably -- have you tried? If it did not work, what errors did you get? Which automated tests failed?
When you say you have "nothing special" in your routes, what does that mean? What does your routes.rb file look like?
Best,
I mean I only have the default routes, that also includes the route in my first post. Here is my routes.rb:
ActionController::Routing::Routes.draw do |map| map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' end
Any ideas? Thank you Søren
Bumping this, I need some help please
neigaard wrote:
Bumping this, I need some help please
Do you have list.json.erb file in your app/view/ ?