Guest User

Untitled

a guest
Jan 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. class API::PaymentsController < ApplicationController
  2. before_filter :set_client
  3.  
  4. def index
  5. @foo = @client.foo
  6. end
  7.  
  8. ...
  9.  
  10. def set_client
  11.  
  12. rescue ActiveRecord::RecordNotFound do |e|
  13. render json: e.message, status: :not_found
  14. end
  15.  
  16. @client = Client.find(params[:client_id])
  17. end
  18. end
Add Comment
Please, Sign In to add comment