Class: Mumukit::Login::Form
- Inherits:
-
Object
- Object
- Mumukit::Login::Form
- Defined in:
- lib/mumukit/login/form.rb
Instance Method Summary collapse
- #button_html(title, clazz) ⇒ Object
- #footer_html ⇒ Object
-
#header_html ⇒ Object
HTML <HEAD> customizations.
-
#initialize(provider, controller, login_settings) ⇒ Form
constructor
This object will configure the login button using the given login settings customizations, if possible.
-
#show! ⇒ Object
Ask the user for authentication, by either rendering the login form or redirecting to it.
Constructor Details
#initialize(provider, controller, login_settings) ⇒ Form
This object will configure the login button using the given login settings customizations, if possible
13 14 15 16 17 |
# File 'lib/mumukit/login/form.rb', line 13 def initialize(provider, controller, login_settings) @provider = provider @controller = controller @login_settings = login_settings end |
Instance Method Details
#button_html(title, clazz) ⇒ Object
27 28 29 |
# File 'lib/mumukit/login/form.rb', line 27 def (title, clazz) @provider.(@controller, title, clazz)&.html_safe end |
#footer_html ⇒ Object
31 32 33 |
# File 'lib/mumukit/login/form.rb', line 31 def @provider.(@controller)&.html_safe end |
#header_html ⇒ Object
HTML <HEAD> customizations. Send this message in order to add login provider-specific code - like CSS and JS - to your page header.
23 24 25 |
# File 'lib/mumukit/login/form.rb', line 23 def header_html @provider.header_html(@controller, @login_settings)&.html_safe end |
#show! ⇒ Object
Ask the user for authentication, by either rendering the login form or redirecting to it
This method should be called from a controller action or action filter.
45 46 47 |
# File 'lib/mumukit/login/form.rb', line 45 def show! @controller.redirect! @provider.login_path(@controller) end |