Created
November 7, 2012 14:23
-
-
Save RemiBa/4031894 to your computer and use it in GitHub Desktop.
Form differences
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for @customer do |c| %> | |
<% if @customer.errors.any? || @customer.authentication.errors.any? %> | |
<div class="form_errors"> | |
<ul> | |
<% if @customer.errors.any? %> | |
<% @customer.errors.full_messages.each do |msg| %> | |
<li> | |
<%= msg %> | |
</li> | |
<%end%> | |
<%end%> | |
<% if @customer.authentication.errors.any? %> | |
<% @customer.authentication.errors.full_messages.each do |msg| %> | |
<li> | |
<%= msg %> | |
</li> | |
<% end %> | |
<%end %> | |
</ul> | |
</div> | |
<% end %> | |
<%= c.fields_for :authentication do |builder| %> | |
<%= builder.label :password%> | |
<%= builder.password_field :password%> | |
<br/> | |
<%= builder.label :password_confirmation %> | |
<%= builder.password_field :password_confirmation %> | |
<br/> | |
<% end %> | |
<%= c.submit "Save your changes"%> | |
<% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h3 id="personaldetails">Personal details</h3> | |
<table border="0"> | |
<tr> | |
<td>Current e-mail:</td> | |
<td><%= @customer.email%></td> | |
</tr> | |
</table> | |
<%= form_for @customer do |c| %> | |
<% if @customer.errors.any? || @customer.authentication.errors.any? %> | |
<div class="form_errors"> | |
<ul> | |
<% if @customer.errors.any? %> | |
<% @customer.errors.full_messages.each do |msg| %> | |
<li> | |
<%= msg %> | |
</li> | |
<%end%> | |
<%end%> | |
<% if @customer.authentication.errors.any? %> | |
<% @customer.authentication.errors.full_messages.each do |msg| %> | |
<li> | |
<%= msg %> | |
</li> | |
<% end %> | |
<%end %> | |
</ul> | |
</div> | |
<% end %> | |
<div class="edit email"> | |
<%= c.label :email%> | |
<%= c.text_field :email, :value => ""%> | |
<%= c.label :email_confirmation %> | |
<%= c.text_field :email_confirmation, :value => ""%> | |
</div> | |
<%= c.fields_for :authentication do |build| %> | |
<div class="edit password"> | |
<%= build.label :password %> | |
<%= build.password_field :password %> | |
<%= build.label :password_confirmation%> | |
<%= build.password_field :password_confirmation %> | |
</div> | |
<% end %> | |
<%= c.submit("Edit profile")%> | |
<% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CHECKING ERROR VALIDATION CHANGEPASSWORD | |
{"utf8"=>"✓", "_method"=>"put", "authenticity_token"=>"LiCv6shHTr8gXVk/fNPmhGk2pJ2uUM2WmQ0mm0OWeLs=", "customer"=>{"authentication_attributes"=>{"password"=>"qdsfqsdf", "password_confirmation"=>"dfqsd", "id"=>"2"}}, "commit"=>"Save your changes", "action"=>"update", "controller"=>"customers", "id"=>"2110002"} | |
-> Customer | |
- authentication_attributes | |
-password | |
-password_confirmation | |
Gives following errors: | |
Password doesn't match confirmation | |
Password is too short (minimum is 5 characters) | |
CHECKING ERROR VALIDATION EDITABLEDETAILS | |
{"utf8"=>"✓", "_method"=>"put", "authenticity_token"=>"LiCv6shHTr8gXVk/fNPmhGk2pJ2uUM2WmQ0mm0OWeLs=", "customer"=>{"email"=>"[email protected]", "email_confirmation"=>"[email protected]", "authentication_attributes"=>{"password"=>"qsdf", "password_confirmation"=>"f", "id"=>"1"}}, "commit"=>"Edit profile", "action"=>"update", "controller"=>"customers", "id"=>"2110001"} | |
-> Customer | |
- email_confirmation | |
- authentication_attributes | |
-password | |
-password_confirmation | |
Gives following errors: | |
Authentication password doesn't match confirmation | |
Authentication password is too short (minimum is 5 characters) | |
Password doesn't match confirmation | |
Password is too short (minimum is 5 characters) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CHECKING ERROR VALIDATION CHANGEPASSWORD | |
{"utf8"=>"✓", "_method"=>"put", "authenticity_token"=>"LiCv6shHTr8gXVk/fNPmhGk2pJ2uUM2WmQ0mm0OWeLs=", "customer"=>{"authentication_attributes"=>{"password"=>"qdsfqsdf", "password_confirmation"=>"dfqsd", "id"=>"2"}}, "commit"=>"Save your changes", "action"=>"update", "controller"=>"customers", "id"=>"2110002"} | |
-> Customer | |
- authentication_attributes | |
-password | |
-password_confirmation | |
Gives following errors: | |
Password doesn't match confirmation | |
Password is too short (minimum is 5 characters) | |
CHECKING ERROR VALIDATION EDITABLEDETAILS | |
{"utf8"=>"✓", "_method"=>"put", "authenticity_token"=>"LiCv6shHTr8gXVk/fNPmhGk2pJ2uUM2WmQ0mm0OWeLs=", "customer"=>{"email"=>"[email protected]", "email_confirmation"=>"[email protected]", "authentication_attributes"=>{"password"=>"qsdf", "password_confirmation"=>"f", "id"=>"1"}}, "commit"=>"Edit profile", "action"=>"update", "controller"=>"customers", "id"=>"2110001"} | |
-> Customer | |
- email_confirmation | |
- authentication_attributes | |
-password | |
-password_confirmation | |
Gives following errors: | |
Authentication password doesn't match confirmation | |
Authentication password is too short (minimum is 5 characters) | |
Password doesn't match confirmation | |
Password is too short (minimum is 5 characters) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment