Skip to content

Commit

Permalink
Readability / whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-megarad committed Mar 15, 2013
1 parent 3cb8d2b commit aaeaaf1
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions lib/negative_captcha/form_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,30 @@ def negative_hidden_field(captcha, method, options = {})
end

def negative_file_field(captcha, method, options = {})
html = @template.negative_file_field_tag(captcha, method, options).html_safe
html = "<div class='fieldWithErrors'>#{html}</div>" if @object.errors[method].present?
html = @template.negative_file_field_tag(
captcha,
method,
options
).html_safe

if @object.errors[method].present?
html = "<div class='fieldWithErrors'>#{html}</div>"
end

html.html_safe
end

def negative_check_box_field(captcha, method, options = {})
html = @template.negative_check_box_tag(captcha, method, options).html_safe
html = "<div class='fieldWithErrors'>#{html}</div>" if @object.errors[method].present?
html = @template.negative_check_box_tag(
captcha,
method,
options
).html_safe

if @object.errors[method].present?
html = "<div class='fieldWithErrors'>#{html}</div>"
end

html.html_safe
end

Expand All @@ -53,7 +69,7 @@ def negative_password_field(captcha, method, options = {})
).html_safe

if @object.errors[method].present?
html = "<div class='fieldWithErrors'>#{html}</div>"
html = "<div class='fieldWithErrors'>#{html}</div>"
end

html.html_safe
Expand All @@ -68,7 +84,7 @@ def negative_label(captcha, method, name, options = {})
).html_safe

if @object.errors[method].present?
html = "<div class='fieldWithErrors'>#{html}</div>"
html = "<div class='fieldWithErrors'>#{html}</div>"
end

html.html_safe
Expand Down

0 comments on commit aaeaaf1

Please sign in to comment.