Sha256: ec21f4963606daa4edff5cff88cddd0f8f16f0bac040900b930f393309df2e01
Contents?: true
Size: 1.55 KB
Versions: 14
Compression:
Stored size: 1.55 KB
Contents
<%= form_for(@user, html: { role: :form }) do |f| %> <% if @user.errors.any? %> <div class="alert alert-danger alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> <strong><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</strong> <ul> <% @user.errors.full_messages.each do |message| %> <li><%= message %></li> <% end %> </ul> </div> <% end %> <% if can? :manage, :all %> <div class="checkbox"> <label for="user_is_admin"> <%= f.check_box :is_admin %>Super User </label> </div> <% end %> <div class="form-group"> <label>Roles</label> <% @roles.each do |role| %> <% role = role.underscore %> <div class="checkbox"> <label for="user_user_roles_<%= role %>"> <input name="user[user_roles][<%= role %>]" type="hidden" value="0"> <input id="user_user_roles_<%= role %>" name="user[user_roles][<%= role %>]" type="checkbox" value="1" <%= "checked" if @user.user_roles.map(&:role_class_name).include?("Roles::#{role.titleize.gsub(' ', '')}") %>> <%= role.tableize.titleize.singularize %> </label> </div> <% end %> </div> <div class="form-group"> <%= f.label :email %> <%= f.text_field :email, class: "form-control" %> </div> <%= f.submit button_text, class: "btn btn-primary" %> <%= link_to "Cancel", cancel_path, class: "btn btn-default" %> <% end %>
Version data entries
14 entries across 14 versions & 1 rubygems