adding routes. catching nulls

This commit is contained in:
Mike McCabe
2014-04-08 23:06:29 -04:00
committed by cktricky
parent c157496b1e
commit 6975f94381
2 changed files with 6 additions and 3 deletions
@@ -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
+4 -3
View File
@@ -33,14 +33,14 @@ Railsgoat::Application.routes.draw do
resources :messages do
end
resources :pay do
collection do
post "update_dd_info"
post "decrypted_bank_acct_num"
end
end
end
get "download" => "benefit_forms#download"
@@ -90,10 +90,11 @@ Railsgoat::Application.routes.draw do
get "home"
end
end
namespace :api, defaults: {format: 'json'} do
namespace :v1 do
resources :users
resources :mobile
end
end