At first , you should write belongs_to :user in ticket model.
And use merge! method to make a relationship between ticket and current_user in create action of tickets_controller.
def create
@ticket = @project.tickets.build(params[:ticket].merge!(:user => current_user))
if @ticket.save
flash[:notice] = "Ticket has been created."
redirect_to [@project,@ticket]
else
flash[:alert] = "Ticket has not been created."
render :action => "new"
end
end