Created
April 17, 2017 08:24
-
-
Save abhisek/3fd6e0521a85f18335a1ecdbfc4dc073 to your computer and use it in GitHub Desktop.
api-scoped-query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Api::V1::ProjectsController < Api::V1::ApiController | |
before_filter :authenticate_api_user! | |
before_filter :load_customer! | |
def index | |
@projects = @customer.projects.order('created_at DESC') | |
render :json => @projects, :except => project_exclusions, | |
:methods => project_inclusions | |
end | |
protected | |
def load_customer! | |
@customer = ::Customer.find(params[:customer_id]) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment