fix error
This commit is contained in:
parent
a17980e7a7
commit
8342a17aca
|
@ -9,7 +9,6 @@
|
|||
<% property = Property.where(id: @data['property_id']).first %>
|
||||
<% if !property.nil? %>
|
||||
<h3><%= property['title'].collect{|k,v| v}.uniq.join('/') rescue nil %></h3>
|
||||
<%= t('property_hire.editor') %>: <%= User.find(user_id).name rescue nil %>
|
||||
<% I18n.with_locale(@data['locale']) do %>
|
||||
<table>
|
||||
<thead>
|
||||
|
@ -19,14 +18,16 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% ['property_usage','note','category','property_location','property_number','can_be_hired','purchase_date','owners','other_owner','owner_email','owner_phone','price'].each do |k| %>
|
||||
<% v = property.send(k) %>
|
||||
<% ['editor','property_usage','note','category','property_location','property_number','can_be_hired','purchase_date','owners','other_owner','owner_email','owner_phone','price'].each do |k| %>
|
||||
<% v = property.send(k) rescue nil %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= k=='category' ? t('category') : t("property_hire.#{k}") %>:
|
||||
</td>
|
||||
<td>
|
||||
<% if ['purchase_date'].include?(k) %>
|
||||
<% if k == 'editor' %>
|
||||
<%= User.find(user_id).name rescue nil %>
|
||||
<% elsif ['purchase_date'].include?(k) %>
|
||||
<%= v.strftime('%Y/%m/%d %H:%M') rescue nil %>
|
||||
<% elsif ['property_usage','note'].include?(k) %>
|
||||
<%= property[k].collect{|k,v| v}.uniq.join('/') rescue nil %>
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
<%= t('property_hire.email_edit_success') %>
|
||||
<% end %>
|
||||
<h3><%= property['title'].collect{|k,v| v}.uniq.join('/') rescue nil %></h3>
|
||||
<%= t('property_hire.editor') %>: <%= User.find(user_id).name rescue nil %>
|
||||
<% I18n.with_locale(@data['locale']) do %>
|
||||
<table>
|
||||
<thead>
|
||||
|
@ -18,14 +17,16 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% ['property_usage','note','category','property_location','property_number','can_be_hired','purchase_date','owners','other_owner','owner_email','owner_phone','price'].each do |k| %>
|
||||
<% v = property.send(k) %>
|
||||
<% ['editor','property_usage','note','category','property_location','property_number','can_be_hired','purchase_date','owners','other_owner','owner_email','owner_phone','price'].each do |k| %>
|
||||
<% v = property.send(k) rescue nil %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= k=='category' ? t('category') : t("property_hire.#{k}") %>:
|
||||
</td>
|
||||
<td>
|
||||
<% if ['purchase_date'].include?(k) %>
|
||||
<% if k == 'editor' %>
|
||||
<%= User.find(user_id).name rescue nil %>
|
||||
<% elsif ['purchase_date'].include?(k) %>
|
||||
<%= v.strftime('%Y/%m/%d %H:%M') rescue nil %>
|
||||
<% elsif ['property_usage','note'].include?(k) %>
|
||||
<%= property[k].collect{|k,v| v}.uniq.join('/') rescue nil %>
|
||||
|
|
Loading…
Reference in New Issue