update file upload validate
This commit is contained in:
parent
ed30fda285
commit
981abf2a3d
|
@ -15,8 +15,10 @@ class EmailErFile
|
||||||
private
|
private
|
||||||
|
|
||||||
def file_size
|
def file_size
|
||||||
if file.file.size > 10.megabytes
|
if !file.blank?
|
||||||
errors.add( :file, I18n.t("er_email.email_file_limit"))
|
if file.file.size > 10.megabytes
|
||||||
|
errors.add( :file, I18n.t("er_email.email_file_limit"))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -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">
|
||||||
|
|
Loading…
Reference in New Issue