Improved error handling of ticket creation.

This commit is contained in:
Martin Edenhofer 2012-04-16 14:47:07 +02:00
parent abb7db9323
commit 879ba366ab
2 changed files with 7 additions and 2 deletions

View file

@ -87,12 +87,13 @@ class Index extends App.Controller
# find sender_id
sender = App.TicketArticleSender.findByAttribute("name", "Customer")
type = App.TicketArticleType.findByAttribute("name", "phone")
if params.group_id
group = App.Group.find(params.group_id)
# create article
params['article'] = {
from: params.customer_id_autocompletion,
to: group.name,
to: (group && group.name) || '',
subject: params.subject,
body: params.body,
ticket_article_type_id: type.id,
@ -128,6 +129,9 @@ class Index extends App.Controller
# create new create screen
@render()
# scroll to top
window.scrollTo(0,0)
error: =>
@log 'save failed!'
)

View file

@ -1,4 +1,5 @@
class TicketsController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :authentication_check
# GET /tickets