Guest User

Untitled

a guest
Jul 23rd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <%
  2. options = {
  3. url: form_url
  4. }
  5. options[:as] = resource_name if defined?(resource_name) && resource_name.present?
  6. %>
  7.  
  8. <%= form_for(resource, options) do |f| %>
  9. <% if !defined?(password_only) || !password_only %>
  10. <%= f.email_field :email %>
  11. <% end %>
  12.  
  13. <% required = false %>
  14. <% if resource.new_record? %>
  15. <% required = true %>
  16. <% end %>
  17. <%= f.password_field :password, autocomplete: "off", required: required %>
  18. <%= f.password_field :password_confirmation, autocomplete: "off" %>
  19. <% if resource.persisted? && !current_user.has_role?(:admin) %>
  20. <%= f.password_field :current_password, autocomplete: "off" %>
  21. <% end %>
  22.  
  23. <%= f.submit %>
  24. <% end %>
Add Comment
Please, Sign In to add comment