daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define 2 methods in global helper
  2. def logged_in_only(is_iser_logged_in)
  3.   yield if is_iser_logged_in == true
  4. end
  5.  
  6. def not_logged_in(is_iser_logged_in)
  7.   yield if is_iser_logged_in == false
  8. end
  9.  
  10. #and then adding the following to my application's layout
  11.  
  12. <% logged_in_only(current_user.logged_in?)  %>
  13.   <p>some info here</p>
  14. <% end %>
  15.  
  16. <% not_logged_in(current_user.logged_in?)  %>
  17.   <p>some other info here</p>
  18. <% end %>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top