Skip to content

Commit

Permalink
Password resets uses map.resources instead of map.resource
Browse files Browse the repository at this point in the history
  • Loading branch information
binarylogic committed Nov 19, 2008
1 parent 6f14d32 commit 05b9ab8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/password_resets_controller.rb
Expand Up @@ -36,7 +36,7 @@ def update

private
def load_user_using_perishable_token
@user = User.find_using_perishable_token(params[:perishable_token])
@user = User.find_using_perishable_token(params[:id])
unless @user
flash[:notice] = "We're sorry, but we could not locate your account." +
"If you are having issues try copying and pasting the URL " +
Expand Down
2 changes: 1 addition & 1 deletion app/models/notifier.rb
Expand Up @@ -6,6 +6,6 @@ def password_reset_instructions(user)
from "Binary Logic Notifier <noreply@binarylogic.com>"
recipients user.email
sent_on Time.now
body :edit_password_reset_url => edit_password_reset_url(:perishable_token => user.perishable_token)
body :edit_password_reset_url => edit_password_reset_url(user.perishable_token)
end
end
2 changes: 1 addition & 1 deletion app/views/password_resets/edit.html.erb
@@ -1,6 +1,6 @@
<h1>Change My Password</h1>

<% form_for @user, :url => password_reset_path(:perishable_token => params[:perishable_token]), :method => :put do |f| %>
<% form_for @user, :url => password_reset_path, :method => :put do |f| %>
<%= f.error_messages %>
<%= f.label :password %><br />
<%= f.password_field :password %><br />
Expand Down
2 changes: 1 addition & 1 deletion app/views/password_resets/new.html.erb
Expand Up @@ -3,7 +3,7 @@
Fill out the form below and instructions to reset your password will be emailed to you:<br />
<br />

<% form_tag password_reset_path do %>
<% form_tag password_resets_path do %>
<label>Email:</label><br />
<%= text_field_tag "email" %><br />
<br />
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
@@ -1,6 +1,6 @@
ActionController::Routing::Routes.draw do |map|
map.resource :account, :controller => "users"
map.resource :password_reset
map.resources :password_resets
map.resources :users
map.resource :user_session
map.default "/", :controller => "user_sessions", :action => "new"
Expand Down

0 comments on commit 05b9ab8

Please sign in to comment.