class Wco::ProductsController
def update
def update authorize! :edit, @product @product = Wco::Product.find params[:id] if @product.update_attributes params[:product].permit! flash[:notice] = 'Success.' redirect_to action: :show, id: @product.id else flash[:alert] = "No luck: #{@product.errors.full_messages.join(', ')}." render action: :edit end end