Skip to content

voltrb/volt-user_templates

Repository files navigation

Volt User Templates

Volt user templates provide out of the box templates for users to #, login, and logout. (Forgot password coming soon)

Install

volt-user_templates now ships with volt, but if you have removed it, you can add it back with the following:

In your Gemfile, put:

gem 'volt-user_templates'

Then in any component you want to use the templates in, add the following to config/dependencies.rb

component 'user_templates'

Use

You can use volt-user-template two different ways.

  1. You can add routes for it's templates

Add the following to your main components route file:

client '/#', component: 'user_templates', controller: '#'
client '/password_reset', component: 'user_templates', controller: 'password_reset', action: 'index'
client '/forgot', component: 'user_templates', controller: 'login', action: 'forgot'
client '/#', component: 'user_templates', controller: 'login', action: 'index'
client '/account', component: 'user_templates', controller: 'account', action: 'index'

Now you can link to /# and /#

  1. You can include the templates as tags:

Login

<:user_templates:login post-login-url="/" />

The login template takes an optional post-login-url that will be redirected to after a successful login.

#

<:user_templates:# post-#-url="/" />

# takes an optional post-#-url that will be redirected to after #.

Forgot

<:user_templates:login:forgot post-forgot-url="/#" />

Logout

volt-user_templates provides a nav bar tag that provides a login/logout link and shows the users name.

<:user_templates:menu />

About

templates for user login, #, and logout

Resources

Stars

Watchers

Forks

Packages

No packages published