Fogbugz #48: View erstellen, um neuen Kontakt anzulegen.
This commit is contained in:
parent
fd4ebb879f
commit
b7ce756f58
1 changed files with 16 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue