Skip to content

Commit

Permalink
making clientside validation a bit easier
Browse files Browse the repository at this point in the history
  • Loading branch information
jomz committed Feb 4, 2010
1 parent 7506878 commit a3a5eb7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/mailer_tags.rb
Expand Up @@ -331,9 +331,13 @@ def mailer_attrs(tag, extras={})
attrs = {
'id' => tag.attr['name'],
'class' => nil,
'size' => nil}.merge(extras)
'size' => nil,
'title' => nil}.merge(extras)
result = attrs.collect do |k,v|
v = (tag.attr[k] || v)
if k == 'class' && tag.attr['required'].present?
v = [v, 'required', tag.attr['required']].compact.join(' ')
end
next if v.blank?
%(#{k}="#{v}")
end.reject{|e| e.blank?}
Expand Down

0 comments on commit a3a5eb7

Please sign in to comment.