Class: TypeStation::Admin::PagesController
- Inherits:
-
TypeStation::AdminController
- Object
- ActionController::Base
- TypeStation::ApplicationController
- TypeStation::AdminController
- TypeStation::Admin::PagesController
- Defined in:
- app/controllers/type_station/admin/pages_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
5 6 7 8 9 10 11 |
# File 'app/controllers/type_station/admin/pages_controller.rb', line 5 def index @pages = TypeStation::Page.in(status: [:draft, :published]) @pages = @pages.where(title: /#{params[:title]}/i) if params[:title] @pages = @pages.where(path: /#{params[:path]}/i) if params[:path] render json: { status: :success, pages: @pages }, status: :ok end |