update file upload validate

This commit is contained in:
spen 2014-10-06 14:35:40 +08:00
parent ed30fda285
commit 981abf2a3d
2 changed files with 6 additions and 2 deletions

View File

@ -15,9 +15,11 @@ class EmailErFile
private private
def file_size def file_size
if !file.blank?
if file.file.size > 10.megabytes if file.file.size > 10.megabytes
errors.add( :file, I18n.t("er_email.email_file_limit")) errors.add( :file, I18n.t("er_email.email_file_limit"))
end end
end end
end
end end

View File

@ -92,6 +92,8 @@
<label class="control-label muted"><%= t(:file_) %></label> <label class="control-label muted"><%= t(:file_) %></label>
<div class="controls"> <div class="controls">
<%= t("er_email.email_file_limit") %>
<!-- Exist --> <!-- Exist -->
<% if @email_er && !@email_er.email_er_files.blank? %> <% if @email_er && !@email_er.email_er_files.blank? %>
<div class="exist"> <div class="exist">