Skip to content

Instantly share code, notes, and snippets.

@stevesohcot
Created January 30, 2016 19:41
Show Gist options
  • Save stevesohcot/4d97a1edb6c4eaf3acef to your computer and use it in GitHub Desktop.
Save stevesohcot/4d97a1edb6c4eaf3acef to your computer and use it in GitHub Desktop.
OmniAuth Identities - "new" view
<!--
NOTE: this is using Bootstrap for styling, and has some additional javascript not in this file.
- Specifically, the "Confirm Password" is hidden, so it will automatically be updated to whatever is in the original
- and the "Show Password" checkbox toggle
-->
<%= form_for(@identity, url:'/auth/identity/register') do |f| %>
<% if @identity.errors.any? %>
<div class="alert alert-danger">
<h2><%= pluralize(@identity.errors.count, "error") %> prohibited this user from being saved:</h2>
<ul>
<% @identity.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<header align="center" style="margin-bottom:15px;">
<h2>Sign Up</h2>
</header>
<div style="width:80%; margin:auto;">
<div class="input-group input-group-lg form-group">
<%= f.label :first_name, "First Name", :class=> 'sr-only' %>
<%= f.text_field :first_name, :name => 'first_name', :class=> "form-control input-lg", :placeholder=> "First Name" %>
</div>
<div class="input-group input-group-lg form-group">
<%= f.label :last_name, "Last Name", :class=> 'sr-only' %>
<%= f.text_field :last_name, :name => 'last_name', :class=> "form-control input-lg", :placeholder=> "Last Name" %>
</div>
<div class="input-group input-group-lg form-group">
<%= f.label :email, "Email", :class=> 'sr-only' %>
<%= f.email_field :email, :name => 'email', :class=> "form-control input-lg", :placeholder=> "Email Address", :data=> {'required' => true } %>
</div>
<div class="input-group input-group-lg form-group">
<%= f.label :password, "Password", :class=> 'sr-only' %>
<%= f.password_field :password, :name => 'password', :class=> "form-control input-lg", :placeholder=>"Password", :data=> {'required' => true } %>
</div>
<div class="form-group" style="display:none;">
<%= f.label :password_confirmation, "Confirm Password", :class=> 'sr-only' %>
<%= f.password_field :password_confirmation, :name => 'password', :class=> "form-control", :placeholder=>"Confirm Password", :data=> {'required' => true } %>
</div>
<div class="form-group">
<%= check_box_tag 'show_password', "Show Password", false%>
<small>Show Password</small>
</div>
<div class="form-group">
<%= f.submit 'Sign Up', :class => "btn btn-primary btn-lg", onClick: "return PwMatchConfirmPw();" %>
<%= link_to 'Log In', login_path, :class => "btn btn-lg" %>
</div>
</div>
<script>
$.toggleShowPassword({
field: '#identity_password',
control: '#show_password'
});
</script
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment