Skip to content

Instantly share code, notes, and snippets.

@MartinHeimbring
Created January 19, 2015 21:19
Show Gist options
  • Save MartinHeimbring/b775e151ce93f908ba8f to your computer and use it in GitHub Desktop.
Save MartinHeimbring/b775e151ce93f908ba8f to your computer and use it in GitHub Desktop.
Devise session form styled with bootstrap
%h2.text-center Sign in
%br/
= form_for(resource, as: resource_name, url: session_path(resource_name), html: {class: 'form-horizontal'}) do |f|
.form-group
= f.label :email, class: "col-sm-2 control-label"
.col-sm-6
= f.email_field :email, autofocus: true , class: "form-control"
.form-group
= f.label :password, class: "col-sm-2 control-label"
.col-sm-6
= f.password_field :password, autocomplete: "off", class: "form-control"
- if devise_mapping.rememberable?
.form-group
.col-sm-6.col-sm-offset-2
= f.check_box :remember_me
= f.label :remember_me
.form-group
.col-sm-6.col-sm-offset-2
= f.submit "Sign in", class: 'btn btn-primary'
.form-group
.col-sm-6.col-sm-offset-2
= render "devise/shared/links"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment