I have a user index and I want to add a button that would send a password reset email when I click it (for when users lose their invitation).
# View
<% @users.each do |user| %>
<%= link_to "Reset Password", reset_password_path(user) %>
<% end %>
# Controller
def reset_password
@user = User.find(params[:id])
email = @user.email
# Fire password reset...
redirect_to users_path
end
Normally Devise uses a form for password reset, but I figured I could override this since the email is known and can be supplied in the params