technoweenie / restful-authentication

Generates common user authentication code for Rails/Merb, with a full test/unit and rspec suite and optional Acts as State Machine support built-in.

This URL has Read+Write access

restful-authentication / generators / authenticated / templates / _model_partial.html.erb
100644 9 lines (8 sloc) 0.631 kb
1
2
3
4
5
6
7
8
9
<%% if logged_in? -%>
  <div id="<%= file_name %>-bar-greeting">Logged in as <%%= link_to_current_<%= file_name %> :content_method => :login %></div>
  <div id="<%= file_name %>-bar-action" >(<%%= link_to "Log out", logout_path, { :title => "Log out" } %>)</div>
<%% else -%>
  <div id="<%= file_name %>-bar-greeting"><%%= link_to_login_with_IP 'Not logged in', :style => 'border: none;' %></div>
  <div id="<%= file_name %>-bar-action" ><%%= link_to "Log in", login_path, { :title => "Log in" } %> /
                               <%%= link_to "Sign up", signup_path, { :title => "Create an account" } %></div>
<%% end -%>