refactors recaptchable helper [#45]

This commit is contained in:
rgarcia
2015-07-28 18:32:45 +02:00
parent c5bfc9420f
commit 81a5ddb580
3 changed files with 4 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
module RecaptchaHelper
def recaptchable?
@debate.new_record?
def recaptchable?(resource)
resource.new_record?
end
def recaptcha_keys?

View File

@@ -30,7 +30,7 @@
<%= t("debates.form.accept_terms") %>
<% end %>
<%= render 'shared/captcha' %>
<%= render 'shared/captcha', resource: @debate %>
<div class="actions">
<%= f.submit %>

View File

@@ -1,3 +1,3 @@
<% if recaptchable? and recaptcha_keys? %>
<% if recaptchable?(resource) and recaptcha_keys? %>
<%= recaptcha_tags ajax: true, hl: I18n.locale %>
<% end %>