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.

Revisions

  1. @invalid-email-address Anonymous created this gist Aug 5, 2015.
    29 changes: 29 additions & 0 deletions _form.html.erb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    <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>