Skip to content

Instantly share code, notes, and snippets.

@rociopaez
Last active August 29, 2015 14:05
Show Gist options
  • Save rociopaez/0a7c2057ec4d96e11d74 to your computer and use it in GitHub Desktop.
Save rociopaez/0a7c2057ec4d96e11d74 to your computer and use it in GitHub Desktop.
<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