Kind of fixed version:
flash[:notice] = ‘Please fill fields marked with *’
redirect_to :action => ‘create_ticket_ui’
ServiceDesk.create_ticket(@contact_id,params[:ticket]) #Now create
new sd ticket
The reason why your editor says it’s wrong is a superfluous end before
There are a couple of other things you want to change here as well, but
depends on your implementation.
- Use ActiveRecord validations to tell the user which field the error
on. This also means you can be very specific about what can go into
- Redirect on successful creation of ticket, not on failure (that way
fields can remain filled out)
Here is a version somewhat easier to work with. I don’t know how
ServiceDesk.create_ticket works, so I modified it to new_ticket (which
doesn’t actually save the ticket that has been created, just returns
@ticket = ServiceDesk.new_ticket(@contact_id, params[:ticket])
redirect_to :action => 'create_ticket_ui'
@ticket ||= ServiceDesk.new_ticket
Hope this helps.
2008/11/4 Sijo Kg firstname.lastname@example.org
error.Could you please help me to solve this? What I tried is to get the
Morgan G. - Just Landed
General Tel: +34 91 590 2611
http://www.justlanded.com - Helping people abroad!
30 countries, in up to 8 languages, more to come…