A website template with lots of features, built with ruby on rails.

paths.rb 579B

1234567891011121314151617181920212223242526272829303132
  1. module NavigationHelpers
  2. def path_to(page_name)
  3. case page_name
  4. when/the homepage/
  5. root_path
  6. when/the admin dashboard/
  7. visit admin_dashboard_path
  8. when/the configurations page/
  9. visit admin_config_path
  10. when/the blog page/
  11. visit blog_path
  12. when/the contact page/
  13. visit contact_messages_path
  14. when/the admin blog posts page/
  15. visit admin_posts_path
  16. else
  17. raise "Can't find mapping from \"#{page_name}\" to a path."
  18. end
  19. end
  20. end
  21. World(NavigationHelpers)