Last active
September 17, 2017 07:01
-
-
Save ramansah/37e150100403a7888681102384a879d0 to your computer and use it in GitHub Desktop.
This file contains 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
def index | |
@articles = Article.all.to_json( | |
:only => [:id, :title, :status, :author] | |
) | |
end | |
def publish | |
article = Article.find(params[:id]) | |
article.publish | |
render json: { | |
success: true, | |
article_status: article.status | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment