Sha256: 3856b2b8ca8a451b1678a70fd6e56ea43b4ddf5266039f492e1e8b4d6952a8c6

Contents?: true

Size: 918 Bytes

Versions: 32

Compression:

Stored size: 918 Bytes

Contents

class AssignmentsController < ArtfullyOseController
  def new
    @order = Order.find(params[:order_id])
    if is_search(params)
      @people = Person.search_index(params[:search].dup, current_user.current_organization)
    else
      @people = Person.recent(current_user.current_organization)
    end
    @people = @people.paginate(:page => params[:page], :per_page => 20)
  end
  
  def create
    @person = Person.find(params[:person_id])
    @order = Order.find(params[:order_id])
    if @order.assign_person(@person)
      flash[:success] = "Order #{@order.id} was successfully assigned to #{@person}."
      redirect_to order_path(@order)
    else
      flash[:error] = "Sorry, but we couldn't assign this order. Contact support if you think this is an error."
      redirect_to new_order_assignment_path(@order)
    end
  end

  private    
    def is_search(params)
      params[:commit].present?
    end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
artfully_ose-1.3.0.pre4 app/controllers/assignments_controller.rb
artfully_ose-1.3.0.pre3 app/controllers/assignments_controller.rb
artfully_ose-1.3.0.pre2 app/controllers/assignments_controller.rb
artfully_ose-1.3.0.pre1 app/controllers/assignments_controller.rb
artfully_ose-1.2.0 app/controllers/assignments_controller.rb
artfully_ose-1.2.0.beta.1 app/controllers/assignments_controller.rb
artfully_ose-1.2.0.alpha.2 app/controllers/assignments_controller.rb
artfully_ose-1.2.0.alpha.1 app/controllers/assignments_controller.rb
artfully_ose-1.2.0.pre.27 app/controllers/assignments_controller.rb
artfully_ose-1.2.0.pre.26 app/controllers/assignments_controller.rb
artfully_ose-1.2.0.pre.24 app/controllers/assignments_controller.rb
artfully_ose-1.2.0.pre.23 app/controllers/assignments_controller.rb
artfully_ose-1.2.0.pre.21 app/controllers/assignments_controller.rb
artfully_ose-1.2.0.pre.20 app/controllers/assignments_controller.rb
artfully_ose-1.2.0.pre.19 app/controllers/assignments_controller.rb
artfully_ose-1.2.0.pre.18 app/controllers/assignments_controller.rb
artfully_ose-1.2.0.pre.17 app/controllers/assignments_controller.rb
artfully_ose-1.2.0.pre.16 app/controllers/assignments_controller.rb
artfully_ose-1.2.0.pre.15 app/controllers/assignments_controller.rb
artfully_ose-1.2.0.pre.12 app/controllers/assignments_controller.rb