Skip to content

Instantly share code, notes, and snippets.

@Yax
Created May 24, 2009 15:52
Show Gist options
  • Select an option

  • Save Yax/117162 to your computer and use it in GitHub Desktop.

Select an option

Save Yax/117162 to your computer and use it in GitHub Desktop.
def create
@ticket = Ticket.new(params[:ticket])
@category = Category.find(@ticket.category_id)
if (@category.tickets << @ticket)
flash[:notice] = "Ticket created."
redirect_to(@ticket)
else
render :action => "new"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment