def index
      # Fix for cancancan not able to merge multiple AR scopes for logged in users
      if can? :edit_content, Alchemy::Page
        @pages = Page.all
      else
        @pages = Page.accessible_by(current_ability, :index)
      end
      if params[:page_layout].present?
        @pages = @pages.where(page_layout: params[:page_layout])
      end
      render json: @pages, adapter: :json, root: :pages
    end
def index
      # Fix for cancancan not able to merge multiple AR scopes for logged in users
      if can? :edit_content, Alchemy::Page
        @pages = Page.all
      else
        @pages = Page.accessible_by(current_ability, :index)
      end
      if params[:page_layout].present?
        @pages = @pages.where(page_layout: params[:page_layout])
      end
      render json: @pages, adapter: :json, root: :pages
    end
Returns all pages as json object