update file upload validate
This commit is contained in:
parent
ed30fda285
commit
981abf2a3d
|
@ -15,9 +15,11 @@ class EmailErFile
|
|||
private
|
||||
|
||||
def file_size
|
||||
if !file.blank?
|
||||
if file.file.size > 10.megabytes
|
||||
errors.add( :file, I18n.t("er_email.email_file_limit"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -92,6 +92,8 @@
|
|||
<label class="control-label muted"><%= t(:file_) %></label>
|
||||
<div class="controls">
|
||||
|
||||
<%= t("er_email.email_file_limit") %>
|
||||
|
||||
<!-- Exist -->
|
||||
<% if @email_er && !@email_er.email_er_files.blank? %>
|
||||
<div class="exist">
|
||||
|
|
Loading…
Reference in New Issue