Last active
August 29, 2015 14:05
-
-
Save rociopaez/0a7c2057ec4d96e11d74 to your computer and use it in GitHub Desktop.
This file contains 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
<h2>Edit Profile</h2> | |
% update_profile = params[:update_profile] | |
% errors = update_profile.errors | |
% if errors | |
% if errors[:name].include?(:not_present) | |
<p>name is no present.</p> | |
% end | |
% if errors[:email].include?(:not_email) | |
<p>email is not valid.</p> | |
% end | |
% if errors[:email].include?(:not_unique) | |
<p>Email has been registered.</p> | |
% end | |
% end | |
<form action="/profile" method="POST"> | |
<fieldset> | |
<label for="name">Name</label> | |
<input id="name" type="text" name="user[name]" value="{{ update_profile.name }}"> | |
<label for="email">Email</label> | |
<input id="email" type="text" name="user[email]" value="{{ update_profile.email }}"> | |
</fieldset> | |
<input type="submit" value="Update"> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment