Skip to content

Instantly share code, notes, and snippets.

@shivamag00
Last active February 23, 2021 18:46

Revisions

  1. shivamag00 renamed this gist Feb 23, 2021. 1 changed file with 0 additions and 0 deletions.
  2. shivamag00 created this gist Feb 23, 2021.
    5 changes: 5 additions & 0 deletions forem-backend_leetcode_articles_controller.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    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