Guest User

Untitled

a guest
Oct 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1.  
  2. class Api::V1::AccountsController < Api::V1::ApplicationController
  3. skip_before_filter :require_access_key, only: [:create]
  4. skip_before_filter :update_limit, only: [:create]
  5.  
  6. # POST /api/v1/accounts
  7. def create
  8. @account = Account.new params[:account]
  9. if @account.valid?
  10. @account.save
  11. render :create, status: :created, formats: [:json]
  12. else
  13. render json: @account.errors, status: :conflict
  14. end
  15. end
  16.  
  17. # GET /api/v1/accounts/:id
  18. def show
  19. @account = Account.find_by_id params[:id]
  20. if @account.present?
  21. render :show, status: :ok, formats: [:json]
  22. else
  23. head :not_found
  24. end
  25. end
  26. end
Add Comment
Please, Sign In to add comment