From eb8c85c18f157299e144c48a7970a0e517227e1d Mon Sep 17 00:00:00 2001 From: Matt Barringer Date: Sun, 20 Jan 2013 13:00:29 +0100 Subject: [PATCH] Don't crash when arrival/departure is null --- app/views/conference_registration/register.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/conference_registration/register.html.haml b/app/views/conference_registration/register.html.haml index a8f8257b..a5867688 100644 --- a/app/views/conference_registration/register.html.haml +++ b/app/views/conference_registration/register.html.haml @@ -17,8 +17,8 @@ = f.input :attending_social_events, :label => false = f.input :attending_social_events_with_partner, :label => false = f.input :using_affiliated_lodging, :label => false - = f.input :arrival, :as => :string, :input_html => {:value => f.object.arrival.to_formatted_s(:db_without_seconds), :id => "conference-reg-start-datepicker", :readonly => "readonly" } - = f.input :departure, :as => :string, :input_html => {:value => f.object.departure.to_formatted_s(:db_without_seconds), :id => "conference-reg-end-datepicker", :readonly => "readonly" } + = f.input :arrival, :as => :string, :input_html => {:value => (f.object.arrival.to_formatted_s(:db_without_seconds) unless f.object.arrival.nil?), :id => "conference-reg-start-datepicker", :readonly => "readonly" } + = f.input :departure, :as => :string, :input_html => {:value => (f.object.departure.to_formatted_s(:db_without_seconds) unless f.object.arrival.nil?), :id => "conference-reg-end-datepicker", :readonly => "readonly" } - if @registered = f.action :submit, :button_html => { :value => "Update Registration", :class => "btn btn-primary" } = link_to "Unregister", register_conference_path(@conference.short_title),:method => :delete, :class => "btn btn-danger",