Use 'Feature's to toggle optional functionality
TODO: Wrap every incomplete project in a feature, and _turn it off_.
This commit is contained in:
parent
a7fce677fc
commit
0aa782711d
5 changed files with 19 additions and 3 deletions
|
|
@ -45,11 +45,10 @@ class RegistrationsController < Devise::RegistrationsController
|
|||
end
|
||||
|
||||
def check_captcha
|
||||
unless verify_recaptcha
|
||||
unless Feature.inactive?(:recaptcha) || verify_recaptcha
|
||||
self.resource = resource_class.new sign_up_params
|
||||
resource.validate # Look for any other validation errors besides Recaptcha
|
||||
respond_with_navigational(resource) { render :new }
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@
|
|||
= f.input :name, input_html: { required: true }, hint: 'This is your real name'
|
||||
= f.input :password, input_html: { required: true }
|
||||
= f.input :password_confirmation, input_html: { required: true }
|
||||
= recaptcha_tags
|
||||
- Feature.with(:recaptcha) do
|
||||
= recaptcha_tags
|
||||
%p.text-right
|
||||
= f.action :submit, as: :button, label: 'Sign Up', button_html: { class: 'btn btn-success' }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue