Sha256: 6abae29c6f011d484b1ec807d808d5446a5087998f9afce12a6af89a0cdbb7cd

Contents?: true

Size: 581 Bytes

Versions: 2

Compression:

Stored size: 581 Bytes

Contents

class SccProductsController < ApplicationController
  before_filter :find_resource, only: [:show, :subscribe, :unsubscribe]
  include Api::TaxonomyScope
  include Foreman::Controller::AutoCompleteSearch

  def index
    # TODO: Organization...
    @scc_products = SccProduct.all
    respond_to do |format|
      format.json { render json: @scc_products.to_json }
    end
  end

  def show
    respond_to do |format|
      format.json { render json: @scc_product.to_json }
    end
  end

  def subscribe
    @scc_product.subscribe
    redirect_to @scc_product.scc_account
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_scc_manager-1.0.1 app/controllers/scc_products_controller.rb
foreman_scc_manager-1.0.0 app/controllers/scc_products_controller.rb