Permalink
Browse files

er: show first guest by default

  • Loading branch information...
1 parent 415d30c commit 6fed219816690261d5acaf7fc5e93ad3561b61e5 Eric Ryan committed Mar 11, 2012
Showing with 18 additions and 17 deletions.
  1. +1 −1 app/helpers/rsvp_helper.rb
  2. 0 app/models/hotel.rb
  3. +2 −1 app/views/rsvp/_guest.html.erb
  4. +15 −15 app/views/rsvp/index.html.erb
@@ -4,7 +4,7 @@ module RsvpHelper
def number_to_word int
@number_to_word ||= {
- 1 => "first",
+ 1 => "your",
2 => "second",
3 => "third",
4 => "fourth",
View
No changes.
@@ -1,6 +1,7 @@
<% @number_str = number_to_word number %>
+<% @hidden_class = 1 == number ? "showing" : "hidden" %>
-<div class="clearfix hidden <%= @class_string %>">
+<div class="clearfix <%= @hidden_class %>">
<%= label_tag(:name, "#{@number_str.capitalize} Guest", :class => 'span5') %>
<%= text_field_tag("#{number}_guest_title".to_sym, nil, :class => 'input span1', :placeholder => 'Mrs.') %>
<%= text_field_tag("#{number}_guest_first_name".to_sym, nil, :class => 'input span3', :placeholder => 'First') %>
@@ -52,6 +52,21 @@
<%= tag "input", {:type => "button", :value => "x", :onclick => "removeGuest()", :class => 'disabled btn small span1', :id => 'remove_guest_button'} %>
</div>
+ <div id="guests">
+ <% 1.upto(10).each_with_index do |i, j| %>
+ <%= render :partial => 'guest', :locals => {:number => j+1} %>
+ <% end %>
+ </div>
+
+ <div class="row">
+ <div class="span11">
+ &nbsp;
+ </div>
+ <div class="span4">
+ <%= tag "input", {:type => "button", :value => "Add Guest", :onclick => "addGuest()", :class => 'btn small span2', :id => 'add_guest_button'} %>
+ </div>
+ </div>
+
<div id="other_fields">
<div class="clearfix">
@@ -64,21 +79,6 @@
<%= text_field_tag(:primary_email, nil, :class => 'input span7', :placeholder => 'fauncy@billups.com') %>
</div>
- <div id="guests">
- <% 1.upto(10).each_with_index do |i, j| %>
- <%= render :partial => 'guest', :locals => {:number => j+1} %>
- <% end %>
- </div>
-
- <div class="row">
- <div class="span11">
- &nbsp;
- </div>
- <div class="span4">
- <%= tag "input", {:type => "button", :value => "Add Guest", :onclick => "addGuest()", :class => 'btn small span2', :id => 'add_guest_button'} %>
- </div>
- </div>
-
</div>
<div class="clearfix">

0 comments on commit 6fed219

Please sign in to comment.