1
unless @client.nil?
TestMailer.snap_shot_error("test1","Errors",
{:file_name => File.basename(upload_file),:client_name => @client.client_name})
else
TestMailer.snap_shot_error("test1","Errors",
{:file_name => File.basename(upload_file))
end
def snap_shot_error(to_address,subject,options={})
# code
end
<% if @client_name %>
<%= _("There were problems with file ") + @file_name + _(" for client ") + @client_name %>
<% else %>
<%= _("There were problems with file ") + @file_name %>
<% end %>
我不想在選項中傳遞client_name鍵。如果@client不可用。 – 2010-11-23 18:52:32