Fogbugz #70: Edit ermoeglichen.

This commit is contained in:
gchq 2011-07-10 23:34:14 +02:00
parent fdbed62568
commit e7d2aca3f3
3 changed files with 39 additions and 23 deletions

View file

@ -10,25 +10,7 @@ class ContactsController < ApplicationController
@contact = Contact.new
email = @contact.emails.build
phone = @contact.phones.build
# list of valid months and days
@months = Array.new
@months << ['Januar', 1]
@months << ['Februar', 2]
@months << ['März', 3]
@months << ['April', 4]
@months << ['Mai', 5]
@months << ['Juni', 6]
@months << ['Juli', 7]
@months << ['August', 8]
@months << ['September', 9]
@months << ['Oktober', 10]
@months << ['November', 11]
@months << ['Dezember', 12]
@days = Array.new
31.times do |d|
@days << [d + 1, d + 1]
end
setup_months_and_days
end
def create
@ -79,6 +61,8 @@ class ContactsController < ApplicationController
end
def edit
@contact = Contact.find(params[:id])
setup_months_and_days
end
def update
@ -87,4 +71,26 @@ class ContactsController < ApplicationController
def destroy
end
private
def setup_months_and_days
# list of valid months and days
@months = Array.new
@months << ['Januar', 1]
@months << ['Februar', 2]
@months << ['März', 3]
@months << ['April', 4]
@months << ['Mai', 5]
@months << ['Juni', 6]
@months << ['Juli', 7]
@months << ['August', 8]
@months << ['September', 9]
@months << ['Oktober', 10]
@months << ['November', 11]
@months << ['Dezember', 12]
@days = Array.new
31.times do |d|
@days << [d + 1, d + 1]
end
end
end

View file

@ -1,2 +1,3 @@
<h1>Contacts#edit</h1>
<p>Find me in app/views/contacts/edit.html.erb</p>
<h1>Edit Contact</h1>
<%= render "form" %>

View file

@ -1,5 +1,11 @@
<div class="row">
<div class="threecol">
<div class="twelvevol">
<div align="center">
<%= link_to 'edit', edit_contact_path %>
</div>
</div>
<div class="threecol show_picture">
[bild]
</div>
<div class="sixcol">
@ -22,8 +28,11 @@
<br />
<em>shared friends</em>
<br />
<em>follow the same</em>
...
<br />
<em>shared followers</em>
<br />
...
</div>
<div class="threecol">&nbsp;</div>
</div>