Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ffa5e0f6fd
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (28 sloc) 0.776 kb
class TicketsController < ApplicationController
before_filter :find_project
before_filter :find_ticket, :only => [:show,
:edit,
:update,
:destroy]
def new
@ticket = @project.tickets.build
end
def create
@ticket = @project.tickets.build(params[:ticket])
if @ticket.save
redirect_to [@project, @ticket], :notice => "Ticket has been created."
else
flash[:alert] = "Ticket has not been created."
render :action => "new"
end
end
def show
end
private
def find_project
@project = Project.find(params[:project_id])
end
def find_ticket
@ticket = @project.tickets.find(params[:id])
end
end
Jump to Line
Something went wrong with that request. Please try again.