Sha256: 84308e8cea97d41535d25c38d46baf58e30c0b720ef845fe8d6774a7181506ad

Contents?: true

Size: 561 Bytes

Versions: 49

Compression:

Stored size: 561 Bytes

Contents

class AssignmentsController < ApplicationController
  before_filter :authenticate_user!

  def create
    @ticket = Ticket.find params[:ticket_id]
    @assignment = @ticket.assignments.build(
      assignment_params.merge(assigner: current_user)
    )

    respond_to do |format|
      format.js
    end
  end

  def update
    # as one would have it
  end

  def destroy
    assignment = Assignment.find params[:id]
    assignment.destroy
  end

  private

  def assignment_params
    params.require(params[:assignment]).permit(:user_id, :priority)
  end

end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
tawork-0.0.50 app/controllers/assignments_controller.rb
tawork-0.0.49 app/controllers/assignments_controller.rb
tawork-0.0.48 app/controllers/assignments_controller.rb
tawork-0.0.47 app/controllers/assignments_controller.rb
tawork-0.0.46 app/controllers/assignments_controller.rb
tawork-0.0.45 app/controllers/assignments_controller.rb
tawork-0.0.44 app/controllers/assignments_controller.rb
tawork-0.0.43 app/controllers/assignments_controller.rb
tawork-0.0.42 app/controllers/assignments_controller.rb
tawork-0.0.41 app/controllers/assignments_controller.rb
tawork-0.0.40 app/controllers/assignments_controller.rb
tawork-0.0.39 app/controllers/assignments_controller.rb
tawork-0.0.38 app/controllers/assignments_controller.rb
tawork-0.0.37 app/controllers/assignments_controller.rb
tawork-0.0.36 app/controllers/assignments_controller.rb
tawork-0.0.35 app/controllers/assignments_controller.rb
tawork-0.0.34 app/controllers/assignments_controller.rb
tawork-0.0.33 app/controllers/assignments_controller.rb
tawork-0.0.31 app/controllers/assignments_controller.rb
tawork-0.0.30 app/controllers/assignments_controller.rb