make some shared devise logic into a helper
This commit is contained in:
parent
9562fb41a8
commit
7c9eb065ba
3 changed files with 6 additions and 2 deletions
|
|
@ -7,4 +7,8 @@ module SessionsHelper
|
|||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def should_display_registration_link?
|
||||
!AppConfig[:registrations_closed] && devise_mapping.registerable? && controller_name != 'registrations'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
= f.submit t('devise.sessions.new.sign_in'), :tabindex => 4
|
||||
|
||||
|
||||
- if !AppConfig[:registrations_closed] && devise_mapping.registerable? && controller_name != 'registrations'
|
||||
- if should_display_registration_link?
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
|
|
|
|||
|
|
@ -24,5 +24,5 @@
|
|||
= link_to "Forgot password?", new_password_path(resource_name)
|
||||
|
||||
%footer
|
||||
- if !AppConfig[:registrations_closed] && devise_mapping.registerable? && controller_name != 'registrations'
|
||||
- if should_display_registration_link?
|
||||
= link_to t('.sign_up'), new_registration_path(resource_name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue