Guest User

Untitled

a guest
Jun 20th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. layout :layout_by_resource
  2. theme :layout_by_resource
  3.  
  4. def layout_by_resource
  5. if devise_controller?
  6. if resource_name == :participant
  7. if subdomain_conference && user_signed_in?
  8. "conf_manage"
  9. elsif subdomain_conference && participant_signed_in?
  10. "conf_participant"
  11. elsif subdomain_conference
  12. theme "default"
  13. else
  14. "login"
  15. end
  16. elsif resource_name == :user
  17. "login"
  18. end
  19. else
  20. layout "application"
  21. end
  22. end
  23.  
  24. /* in layout_by_resource there is a lot of layouts and themes to choose from.
  25. layout :layout_by_resource * should return layout *
  26. theme :layout_by_resource * should return theme *
  27.  
  28. i'm looking for a solution for dynamic choose "layout" or "them".
  29. as the above example will return error.
  30. */
Add Comment
Please, Sign In to add comment