Skip to content

Instantly share code, notes, and snippets.

@askehansen
Created December 5, 2013 13:47
Show Gist options
  • Save askehansen/7805385 to your computer and use it in GitHub Desktop.
Save askehansen/7805385 to your computer and use it in GitHub Desktop.
sessions/edit.html.erb devise for bootstrap 3.x
<div class="row">
<div class="col-sm-offset-2 col-sm-4">
<h1>Change your password</h1>
</div>
</div>
<hr>
<div class="row">
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, class: 'form-horizontal' }) do |f| %>
<%= devise_error_messages! %>
<%= f.hidden_field :reset_password_token %>
<div class="form-group">
<label class="col-sm-2 control-label"><%= f.label :password, "New password" %></label>
<div class="col-sm-4">
<%= f.password_field :password, class: 'form-control', :autofocus => true %>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"><%= f.label :password_confirmation, "Confirm new password" %></label>
<div class="col-sm-4">
<%= f.password_field :password_confirmation, class: 'form-control' %>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-4">
<%= f.submit "Change my password", class: 'btn btn-primary' %>
</div>
</div>
<% end %>
</div>
<hr>
<div class="row">
<div class="col-sm-offset-2 col-sm-3">
<%= render "devise/shared/links" %>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment