Skip to content

Instantly share code, notes, and snippets.

@shivamag00
Last active February 23, 2021 18:46
def get_article_by_id
@articles = Article.find(params[:id]).as_json(only: [:id, :title, :slug, :description, :processed_html, :tag_list])
msg = { :status => "ok", :message => "Success!", :html => "<b>...</b>" }
render :json => @articles
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment