Sha256: c5b9006ae002552d6048959012a91adea53b961ed7d0e34e2038d6d92b7acb3f

Contents?: true

Size: 446 Bytes

Versions: 35

Compression:

Stored size: 446 Bytes

Contents

class ReturnsController < ArtfullyOseController
  def create
    order = Order.find(params[:order_id])
    items = params[:items].collect { |item_id| Item.find(item_id) }

    @return = Return.new(order, items)
    @return.submit

    if @return.successful?
      flash[:notice] = "Successfully returned #{@return.items.size} tickets."
    else
      flash[:error] = "Unable to return tickets."
    end

    redirect_to order_url(order)
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
artfully_ose-1.2.0.pre.11 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.10 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.9 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.8 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.7 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.6 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.5 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.4 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.3 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.2 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.1 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre app/controllers/returns_controller.rb
artfully_ose-1.1.0 app/controllers/returns_controller.rb
artfully_ose-1.1.0.rc2 app/controllers/returns_controller.rb
artfully_ose-1.1.0.rc1 app/controllers/returns_controller.rb