Skip to content

Instantly share code, notes, and snippets.

@ldco2016
Created November 9, 2016 02:36
Show Gist options
  • Select an option

  • Save ldco2016/117b8a16a3644226b6132da90ccf41f0 to your computer and use it in GitHub Desktop.

Select an option

Save ldco2016/117b8a16a3644226b6132da90ccf41f0 to your computer and use it in GitHub Desktop.
evolution of sign up form
<h2 class='text-center'>Sign up</h2>
<div class="row">
<div class="col-md-12">
<%= form_for(resource, as: resource_name, :html => {class: "form-horizonal", role: "form"}, url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
</div>
</div>
<div class="form-group">
<div class="control-label col-md-3">
<%= f.label :email %>
</div>
<div class="col-md-9">
<%= f.email_field :email, class: 'form-control' autofocus: true %>
</div>
</div>
<div class="field">
<%= f.label :password %>
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em>
<% end %><br />
<%= f.password_field :password, autocomplete: "off" %>
</div>
<div class="field">
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation, autocomplete: "off" %>
</div>
<div class="actions">
<%= f.submit "Sign up" %>
</div>
# Above you see how this code is developing to provide a more presentable user experience designed sign up form. I change the div
class of field to form-control and even inside of that I create a columns according to bootstrap.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment