Skip to content

Commit

Permalink
Initial work on redirecting to the correct user page.
Browse files Browse the repository at this point in the history
  • Loading branch information
LindseyB committed Mar 29, 2011
1 parent 199000e commit 23b27ec
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ class Rstatus

user = User.first :username => params[:slug]
if user.nil?
raise Sinatra::NotFound
user = User.first("$where" => "this.username.match(/#{params[:slug]}/i)")
if user.nil?
raise Sinatra::NotFound
else
redirect "/users/#{user.username}"
end
end
@author = user.author
#XXX: the following doesn't work for some reasond
Expand Down

0 comments on commit 23b27ec

Please sign in to comment.