Sha256: f6a3c562d4310ffecd77b09111982aa706ec9eacc03c483db8deb7bf96b1b83f

Contents?: true

Size: 871 Bytes

Versions: 110

Compression:

Stored size: 871 Bytes

Contents

class IshManager::CoTailorsController < IshManager::ApplicationController

  def home
    authorize! :home, ::CoTailors
    @products = ::CoTailors::Product.all
  end

  def create_product
    authorize! :create, ::CoTailors::Product
    @product = ::CoTailors::Product.new params[:co_tailors_product].permit!
    if @product.save
      flash[:notice] = 'Created product'
    else
      flash[:alert] = 'Cannot create product: ', @product.errors.messages.to_s
    end
    redirect_to :action => 'home'
  end

  def update_product
    @product = ::CoTailors::Product.find params[:id]
    authorize! :update, @product
    if @product.update_attributes params[:co_tailors_product].permit!
      flash[:notice] = 'updated product'
    else
      flash[:alert] = 'Cannot update product: ', @product.errors.messages.to_s
    end
    redirect_to :action => 'home'
  end


end

Version data entries

110 entries across 110 versions & 1 rubygems

Version Path
ish_manager-0.1.8.274 app/controllers/ish_manager/trash/co_tailors_controller.rb
ish_manager-0.1.8.273 app/controllers/ish_manager/trash/co_tailors_controller.rb
ish_manager-0.1.8.272 app/controllers/ish_manager/trash/co_tailors_controller.rb
ish_manager-0.1.8.271 app/controllers/ish_manager/trash/co_tailors_controller.rb
ish_manager-0.1.8.268 app/controllers/ish_manager/trash/co_tailors_controller.rb
ish_manager-0.1.8.266 app/controllers/ish_manager/trash/co_tailors_controller.rb
ish_manager-0.1.8.265 app/controllers/ish_manager/trash/co_tailors_controller.rb
ish_manager-0.1.8.264 app/controllers/ish_manager/trash/co_tailors_controller.rb
ish_manager-0.1.8.263 app/controllers/ish_manager/trash/co_tailors_controller.rb
ish_manager-0.1.8.261 app/controllers/ish_manager/co_tailors_controller.rb
ish_manager-0.1.8.260 app/controllers/ish_manager/co_tailors_controller.rb
ish_manager-0.1.8.259 app/controllers/ish_manager/co_tailors_controller.rb
ish_manager-0.1.8.258 app/controllers/ish_manager/co_tailors_controller.rb
ish_manager-0.1.8.257 app/controllers/ish_manager/co_tailors_controller.rb
ish_manager-0.1.8.256 app/controllers/ish_manager/co_tailors_controller.rb
ish_manager-0.1.8.255 app/controllers/ish_manager/co_tailors_controller.rb
ish_manager-0.1.8.254 app/controllers/ish_manager/co_tailors_controller.rb
ish_manager-0.1.8.253 app/controllers/ish_manager/co_tailors_controller.rb
ish_manager-0.1.8.252 app/controllers/ish_manager/co_tailors_controller.rb
ish_manager-0.1.8.251 app/controllers/ish_manager/co_tailors_controller.rb