daily pastebin goal
27%
SHARE
TWEET

Untitled

a guest May 16th, 2018 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #for application helper
  2.  
  3. def special_stylesheet_link
  4.   if session[:toggle_style]
  5.     return stylesheet_link_tag 'alternate'
  6.   else
  7.     return stylesheet_link_tag 'display'
  8.   end
  9. end
  10.  
  11.  
  12. #controller action
  13.  
  14. def toggle_style
  15.   if session[:toggle_style]
  16.     session.delete(:toggle_style)
  17.   else
  18.     session[:toggle_style] = 1
  19.   end
  20.  
  21.   redirect_to '/'
  22. end
RAW Paste Data
Top