Skip to content

Instantly share code, notes, and snippets.

@Yax
Created May 24, 2009 16:29
Show Gist options
  • Select an option

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

Select an option

Save Yax/117179 to your computer and use it in GitHub Desktop.
def create
if @ticket.save
flash[:notice] = "ticket created."
redirect_to(@ticket)
else
render :action => "new"
end
end
def validate
errors.add(:category_id, "is not a valid category") if self.category.nil?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment