Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Api::V1::AccountsController < Api::V1::ApplicationController
- skip_before_filter :require_access_key, only: [:create]
- skip_before_filter :update_limit, only: [:create]
- # POST /api/v1/accounts
- def create
- @account = Account.new params[:account]
- if @account.valid?
- @account.save
- render :create, status: :created, formats: [:json]
- else
- render json: @account.errors, status: :conflict
- end
- end
- # GET /api/v1/accounts/:id
- def show
- @account = Account.find_by_id params[:id]
- if @account.present?
- render :show, status: :ok, formats: [:json]
- else
- head :not_found
- end
- end
- end
Add Comment
Please, Sign In to add comment