Skip to content

Instantly share code, notes, and snippets.

Created August 5, 2015 20:03
Show Gist options
  • Select an option

  • Save anonymous/4261cc34b2844fb05da0 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/4261cc34b2844fb05da0 to your computer and use it in GitHub Desktop.
<div class="col-md-4">
<%= form_for(@user, url: edit_user_path, method: :get) do |f| %>
<% if @user.errors.any? %>
<div id="error_explanation">
<p><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</p>
<ul>
<% @user.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="form-group">
<%= f.label :email %><br>
<%= f.text_field :email, class: "form-control" %>
<br>
<%= f.text_field :role, class: "form-control" %>
</div>
<%= f.submit 'Save user', :class => 'btn btn-primary' %>
<%= link_to 'Back', users_path, class: "btn btn-primary" %>
<% end %>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment