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.3.0.pre4 app/controllers/returns_controller.rb
artfully_ose-1.3.0.pre3 app/controllers/returns_controller.rb
artfully_ose-1.3.0.pre2 app/controllers/returns_controller.rb
artfully_ose-1.3.0.pre1 app/controllers/returns_controller.rb
artfully_ose-1.2.0 app/controllers/returns_controller.rb
artfully_ose-1.2.0.beta.1 app/controllers/returns_controller.rb
artfully_ose-1.2.0.alpha.2 app/controllers/returns_controller.rb
artfully_ose-1.2.0.alpha.1 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.27 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.26 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.24 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.23 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.21 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.20 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.19 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.18 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.17 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.16 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.15 app/controllers/returns_controller.rb
artfully_ose-1.2.0.pre.12 app/controllers/returns_controller.rb