Permalink
Browse files

Se crearon check buttonpara complementar la aplicacion

  • Loading branch information...
1 parent 8eb8fa8 commit e857b36bba9d167c8fc582baec13db67a21f0a8b @GeorgeVajrapani committed Apr 3, 2012
View
18 app/views/contacts/_form.html.erb
@@ -19,18 +19,28 @@
<%= f.label :birthdate %><br />
<%= f.datetime_select :birthdate %>
</div>
-
<div class="field">
<%= f.label :sex %><br />
<div>
<%= f.radio_button(:sex, "male") %>
- <%= f.label(:sex_male, "male") %>
+ <%= f.label(:sex_male, "Male") %>
<%= f.radio_button(:sex, "female") %>
- <%= f.label(:sex_female, "female") %>
+ <%= f.label(:sex_female, "Female") %>
+ </div>
+ </div>
+
+ <div class="field">
+ <%= f.label :languages %><br />
+ <div>
+ <%= f.check_box(:languages_english) %>
+ <%= f.label(:languages_english, "English") %>
+ <%= f.check_box(:languages_spanish) %>
+ <%= f.label(:languages_sapnish, "Spanish") %>
+ <%= f.check_box(:languages_german) %>
+ <%= f.label(:languages_german, "German") %>
</div>
</div>
-
<div class="field">
<%= f.label :email %><br />
View
6 app/views/contacts/index.html.erb
@@ -5,6 +5,9 @@
<th>Name</th>
<th>Birthdate</th>
<th>Sex</th>
+ <th>English</th>
+ <th>Spanish</th>
+ <th>German</th>
<th>Email</th>
<th>Street number</th>
<th>Colony</th>
@@ -20,6 +23,9 @@
<td><%= contact.name %></td>
<td><%= contact.birthdate %></td>
<td><%= contact.sex %></td>
+ <td><%= contact.languages_english %></td>
+ <td><%= contact.languages_spanish %></td>
+ <td><%= contact.languages_german %></td>
<td><%= contact.email %></td>
<td><%= contact.street_number %></td>
<td><%= contact.colony %></td>
View
14 app/views/contacts/show.html.erb
@@ -15,6 +15,20 @@
<%= @contact.sex %>
</p>
+<p>
+ <b>English:</b>
+ <%= @contact.languages_english %>
+</p>
+
+<p>
+ <b>Spanish:</b>
+ <%= @contact.languages_spanish %>
+</p>
+
+<p>
+ <b>German:</b>
+ <%= @contact.languages_german %>
+</p>
<p>
<b>Email:</b>
View
3 db/migrate/20120402142512_create_contacts.rb
@@ -4,6 +4,9 @@ def self.up
t.string :name
t.datetime :birthdate
t.string :sex
+ t.boolean :languages_english
+ t.boolean :languages_spanish
+ t.boolean :languages_german
t.string :email
t.string :street_number
t.string :colony
View
3 db/schema.rb
@@ -16,6 +16,9 @@
t.string "name"
t.datetime "birthdate"
t.string "sex"
+ t.boolean "languages_english"
+ t.boolean "languages_spanish"
+ t.boolean "languages_german"
t.string "email"
t.string "street_number"
t.string "colony"

0 comments on commit e857b36

Please sign in to comment.