RailsCasts Pro episodes are now free!

Learn more or hide this

Darren Wallace's Profile

GitHub User: ddubyah

Site: www.cdsm.co.uk

Comments by Darren Wallace

Avatar

Hey guys. Delighted there's now more Railscasts loveliness each week. Yay.

I'm a little confused about what to do with application wide presenters. For example, I want to show either a "Sign In" link or a "Log Out" link depending on whether the user's logged in. This is somewhere I would normally include some logic in the view, probably the app layout and it'd be great to move it to a presenter. But which one?

I'm playing with Sorcery following your recent episode, so I have a current_user object I can inspect to determine whether anybody's logged in. But it's not referenced through a model so I don't know how to move it to a decorator. I could decorate the user model but creating an @user instance in every view feels, well, odd.

Any guidance would be gratefully received.