Topic: difference between logged in user and another user's profile page
I've been steadily trucking along with my senior project here. I have a theory question though that I think I have all wrong:
Right now, the site shows a members page with the url .com/members/user_name. So, mine would be .com/members/kgosser. I'm using this routing code to get it done:
map.with_options :controller => 'members' do |m|
m.login 'members/login', :action => 'login'
m.logout 'members/logout', :action => 'logout'
m.authorize 'members/authorize', :action => 'authorize'
m.all 'members/all', :action => 'all'
m.signup 'members/signup', :action => 'signup'
m.index 'members/:member', :action => 'index'
m.connect 'members/', :action => 'all'
I'm sending a parameter ":member" with a the pseudo action. So, .com/members/kgosser will give the param[:member]=kgosser.
I seem to be messing up with a logged in user viewing someone else's profile though. So, like if I'm logged in under my username, and I view .com/members/jsmith, I can edit his profile, etc.
I think my issue is because I'm confusing the role of session[:user] and params[:member].
On top of that, I'm getting params[:member] to be null far too often.
Any advice? I can post code snippits if someone needs it. Thanks for the replies.