Skip to content
This repository has been archived by the owner on Dec 21, 2018. It is now read-only.

Commit

Permalink
Change over to html5 validations and remove previous error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
David Bragdon committed Sep 10, 2014
1 parent 440d033 commit 2853117
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 50 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/styleguide.scss
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ input[type='checkbox'] {
right: 20px;
}

#error_explanation h3 {
#error_explanation h2 {
font-size: 14px;
margin: 10px;
}
Expand Down
29 changes: 0 additions & 29 deletions app/helpers/devise_helper.rb

This file was deleted.

9 changes: 4 additions & 5 deletions app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@
<h2>Sign Up</h2>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div>
<%= f.text_field :username, autofocus: true, placeholder: 'Username' %></div>
<%= f.text_field :username, autofocus: true, placeholder: 'Username', :required => true %></div>

<div>
<%= f.email_field :email, placeholder: 'Email' %></div>
<%= f.email_field :email, placeholder: 'Email', :required => true %></div>

<div>
<%= f.password_field :password, autocomplete: "off", placeholder: 'Password' %></div>
<%= f.password_field :password, autocomplete: "off", placeholder: 'Password', :required => true %></div>

<div>
<%= f.password_field :password_confirmation, autocomplete: "off", placeholder: 'Confirm Password' %></div>
<%= f.password_field :password_confirmation, autocomplete: "off", placeholder: 'Confirm Password', :required => true %></div>

<div><%= f.submit "Sign Up" %></div>

Expand Down
6 changes: 2 additions & 4 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
<div class="loginform">
<h2>Log In</h2>
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div><%= f.email_field :email, autofocus: true, placeholder: 'Email' %></div>
<div><%= f.email_field :email, autofocus: true, placeholder: 'Email', :required => true %></div>

<div><%= f.password_field :password, autocomplete: "off", placeholder: 'Password' %></div>
<div><%= f.password_field :password, autocomplete: "off", placeholder: 'Password', :required => true %></div>

<% if devise_mapping.rememberable? -%>
<div id="rememberme"><%= f.check_box :remember_me %><span id="remember">remember me</span></div>
<% end -%>

<div><%= f.submit "Log In" %></div>

<% end %>
</div>
</div>
Expand Down
12 changes: 1 addition & 11 deletions app/views/stories/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,10 @@
<div class="absolute-center">
<div class="newstoryform">
<h2>What's your story's title?</h2>

<%= form_for @story do |f| -%>

<%= f.text_field :name, placeholder: 'Title' %> <br>

<%= f.text_field :name, placeholder: 'Title', :required => true %> <br>
<%= f.submit "Submit", :disable_with => 'Submiting...' %>
<% end -%>
<% if @story.errors.full_messages.count > 0 %>
<div id="error_explanation">
<% @story.errors.full_messages.each do |msg| %>
<h3><%= msg %></h3>
<% end %>
</div>
<% end %>
</div>
</div>
</div>

0 comments on commit 2853117

Please sign in to comment.