Fogbugz #48: View erstellen, um neuen Kontakt anzulegen.

This commit is contained in:
Roland 2011-05-15 23:06:15 +02:00
parent fd4ebb879f
commit b7ce756f58

View file

@ -9,6 +9,22 @@ class ContactsController < ApplicationController
end
def create
c = Contact.new
c.firstname = params[:contact][:firstname]
c.lastname = params[:contact][:lastname]
c.street = params[:contact][:street]
c.housenr = params[:contact][:housenr]
c.plz = params[:contact][:plz]
c.place = params[:contact][:place]
c.country = params[:contact][:country]
if c.save
flash[:notice] = 'Kontakt hervorragend angelegt!'
redirect_to :action => 'index'
else
flash[:error] = 'Fehler beim Speichern eines neuen Kontakts'
render :action => 'new'
end
end
def show