attachment.nil?

This commit is contained in:
yanxd 2013-12-19 16:04:01 +08:00
parent 60be338848
commit 7068359e9e
1 changed files with 1 additions and 1 deletions

View File

@ -1,5 +1,5 @@
var fileSpan = $('#attachments_<%= j params[:attachment_id] %>');
<% if @attachment.new_record? %>
<% if(!@attachment.nil? && @attachment.new_record?) %>
fileSpan.hide();
alert("<%= escape_javascript @attachment.errors.full_messages.join(', ') %>");
<% else %>