Class: SccProductsController

Inherits:
ApplicationController
  • Object
show all
Includes:
Foreman::Controller::AutoCompleteSearch
Defined in:
app/controllers/scc_products_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
10
11
# File 'app/controllers/scc_products_controller.rb', line 5

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

#showObject



13
14
15
16
17
# File 'app/controllers/scc_products_controller.rb', line 13

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

#subscribeObject



19
20
21
22
# File 'app/controllers/scc_products_controller.rb', line 19

def subscribe
  @scc_product.subscribe
  redirect_to @scc_product.
end