mjacobus/recruiter

View on GitHub
app/controllers/recruiter/articles_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Recruiter
  class ArticlesController < ::RecruiterController
    respond_to :html, :json

    def index
      @articles = scope
      respond_with(@articles)
    end

    def show
      @article = scope.find(params[:id])
      ensure_canonical_url(@article) do
        respond_with(@article)
      end
    end

    private

    def scope
      Article.published
    end

  end
end