<% module_namespacing do -%>
class <%= plural_name.camelize %>Controller < ForestController
  before_action :set_<%= singular_name %>, only: [:show]

  def index
    # TODO: active/statusable scope
    @<%= plural_name %> = apply_scopes(<%= name %>)
  end

  def show
    authorize @<%= singular_name %>
  end

  private

    def set_<%= singular_name %>
      @<%= singular_name %> = <%= name %>.find_by!(slug: params[:id])
    end
end
<% end -%>

<% module_namespacing do -%>
class <%= plural_name.camelize %>Controller < ForestController
  before_action :set_<%= singular_name %>, only: [:show]

  def index
    # TODO: published/statusable scope
    @<%= plural_name %> = apply_scopes(<%= name %>)
  end

  def show
    authorize @<%= singular_name %>
  end

  private

    def set_<%= singular_name %>
      @<%= singular_name %> = <%= name %>.find_by!(slug: params[:id])
    end
end
<% end -%>

Change post active/statusable scope comment to read published
Change post active/statusable scope comment to read published
