Class: Api::V1::PostsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/phcpresspro/api/v1/posts_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject

Article Category API



10
11
12
# File 'app/controllers/phcpresspro/api/v1/posts_controller.rb', line 10

def index
  @article_posts = Article::Post.where(pststatus: 'published').order('created_at ASC')
end

#showObject

Article Show



15
16
17
# File 'app/controllers/phcpresspro/api/v1/posts_controller.rb', line 15

def show
  @article_post = Article::Post.where(pststatus: 'published').find(params[:id])
end