Modified: trunk/app/controllers/userhistory_controller.rb (2415 => 2416)
--- trunk/app/controllers/userhistory_controller.rb 2010-05-26 13:54:44 UTC (rev 2415)
+++ trunk/app/controllers/userhistory_controller.rb 2010-05-27 09:36:14 UTC (rev 2416)
@@ -32,9 +32,22 @@
rescue ActiveRecord::RecordNotFound
error("User not found", "is invalid", :user_id)
+ return false
end
else
@user = User.find(params[:id])
end
end
-end
\ No newline at end of file
+
+private
+
+ def error(notice, message, attr=:id)
+ flash[:error] = notice
+ (err = User.new.errors).add(attr, message)
+
+ respond_to do |format|
+ format.html { redirect_to users_url }
+ end
+ end
+
+end