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.29 app/controllers/assignments_controller.rb
tawork-0.0.28 app/controllers/assignments_controller.rb
tawork-0.0.27 app/controllers/assignments_controller.rb
tawork-0.0.26 app/controllers/assignments_controller.rb
tawork-0.0.25 app/controllers/assignments_controller.rb
tawork-0.0.24 app/controllers/assignments_controller.rb
tawork-0.0.23 app/controllers/assignments_controller.rb
tawork-0.0.22 app/controllers/assignments_controller.rb
tawork-0.0.21 app/controllers/assignments_controller.rb
tawork-0.0.20 app/controllers/assignments_controller.rb
tawork-0.0.19 app/controllers/assignments_controller.rb
tawork-0.0.18 app/controllers/assignments_controller.rb
tawork-0.0.17 app/controllers/assignments_controller.rb
tawork-0.0.16 app/controllers/assignments_controller.rb
tawork-0.0.15 app/controllers/assignments_controller.rb
tawork-0.0.14 app/controllers/assignments_controller.rb
tawork-0.0.13 app/controllers/assignments_controller.rb
tawork-0.0.12 app/controllers/assignments_controller.rb
tawork-0.0.11 app/controllers/assignments_controller.rb
tawork-0.0.10 app/controllers/assignments_controller.rb