adding routes. catching nulls
This commit is contained in:
@@ -16,6 +16,8 @@ class Api::V1::MobileController < ApplicationController
|
||||
if params[:class]
|
||||
model = params[:class].classify.constantize
|
||||
respond_with model.all.to_json
|
||||
else
|
||||
respond_with nil.to_json
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -94,6 +94,7 @@ Railsgoat::Application.routes.draw do
|
||||
namespace :api, defaults: {format: 'json'} do
|
||||
namespace :v1 do
|
||||
resources :users
|
||||
resources :mobile
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user