Hi,
I'd like to define the root path of my site as the Users#Show action,
therefore whenever someone goes to http://www.example.com they will see
their own profile page.
At the moment I have done this by having the following in my routes.rb
file:
  # Home Page
  map.root :controller => 'users', :action => 'show'

The Users controller then looks like:
  def show
    @user = current_user
  end

This works with respect to showing each users profile page on the route
page.  However, if tries to go to http://www.example.com/users/anything
they still see their profile page because I am setting @user to
current_user no matter what the request.
I need to return 404 pages when users go to:
http://www.example.com/users/anything_other_than_their_id

What is the correct way to do this?
Thanks
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to