_form.html.erb 1.0 KB

1234567891011121314151617181920212223242526272829
  1. <%= form_for([:admin, @user], html: { class: 'form-horizontal' }) do |f| %>
  2. <%= render "devise/shared/error_messages", resource: resource %>
  3. <%= render partial: '/devise/registrations/common_registration_fields', locals: { f: f } %>
  4. <div class="form-group">
  5. <div class="col-md-offset-4 col-md-10">
  6. <%= f.label :admin do %>
  7. <%= f.check_box :admin %> Admin
  8. <% end %>
  9. </div>
  10. </div>
  11. <div class="form-group">
  12. <div class="col-md-offset-4 col-md-10">
  13. <%= f.submit class: "btn btn-primary" %>
  14. </div>
  15. </div>
  16. <% end %>
  17. <hr>
  18. <div class="row">
  19. <div class="col-md-12">
  20. <%= link_to icon_tag('glyphicon-chevron-left') + ' Back'.html_safe, admin_users_path, class: "btn btn-default" %>
  21. <% if @user.persisted? && @user.active? && @user != current_user %>
  22. <%= link_to 'Become User', switch_to_user_admin_user_path(@user), class: "btn btn-default btn-info", data: { confirm: 'This will log you in as another user. Would you like to continue?' } %>
  23. <% end %>
  24. </div>
  25. </div>