I'm building JSON api controllers.
my routes.rb has:
namespace :api do
resources :users
end
controllers/api/users.rb:
respond_to :json
def create
@user = User.create(params[:user])
respond_with(@user)
end
when posting to api/users.json a new user is created but I'm getting an exception saying user_url method is missing. if i add: resources :users to routes.rb everything is fine. what's happening? any other way to solve this ?