Skip to content

Instantly share code, notes, and snippets.

@nu7hatch
Created December 5, 2011 20:57
Show Gist options
  • Save nu7hatch/1435306 to your computer and use it in GitHub Desktop.
Save nu7hatch/1435306 to your computer and use it in GitHub Desktop.
class CurrentUser::GuestBoxCell < CurrentUser::ProfileBoxCell
end
class CurrentUser::ProfileBoxCell < Cell::Rails
helper FrontHelper
helper SessionsHelper
helper UsersHelper
build do |opts|
CurrentUser::GuestBoxCell unless logged_in?
end
def show
@user = parent_controller.current_user
render
end
end
<ul id="guest_links">
<li><%= hop_on_board_link %></li>
</ul>
<ul id="current_user_links">
<li class="welcome">Welcome <%= link_to_user @user %></li>
<li><%= logout_link %></li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment