refactors recaptchable helper [#45]
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
module RecaptchaHelper
|
module RecaptchaHelper
|
||||||
|
|
||||||
def recaptchable?
|
def recaptchable?(resource)
|
||||||
@debate.new_record?
|
resource.new_record?
|
||||||
end
|
end
|
||||||
|
|
||||||
def recaptcha_keys?
|
def recaptcha_keys?
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<%= t("debates.form.accept_terms") %>
|
<%= t("debates.form.accept_terms") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= render 'shared/captcha' %>
|
<%= render 'shared/captcha', resource: @debate %>
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<%= f.submit %>
|
<%= f.submit %>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<% if recaptchable? and recaptcha_keys? %>
|
<% if recaptchable?(resource) and recaptcha_keys? %>
|
||||||
<%= recaptcha_tags ajax: true, hl: I18n.locale %>
|
<%= recaptcha_tags ajax: true, hl: I18n.locale %>
|
||||||
<% end %>
|
<% end %>
|
||||||
Reference in New Issue
Block a user