Sha256: 0cb647a9bc32b87c3a3cba943a6a9a23a63dfc4dec94852313cb9c0af210974f

Contents?: true

Size: 602 Bytes

Versions: 8

Compression:

Stored size: 602 Bytes

Contents

module NavigationHelpers
  module Refinery
    module Pages
      def path_to(page_name)
        case page_name
        when /the home\s?page/
          root_path
        when /the list of pages/
          admin_pages_path
        when /the new page form/
          new_admin_page_path
        else
          begin
            if page_name =~ /the page titled "?([^\"]*)"?/ and (page = Page.where(:title => $1).first).present?
              self.url_for(page.url)
            else
              nil
            end
          rescue
            nil
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
refinerycms-pages-0.9.9.8 features/support/paths.rb
refinerycms-pages-0.9.9.7 features/support/paths.rb
refinerycms-pages-0.9.9.5 features/support/paths.rb
refinerycms-pages-0.9.9.4 features/support/paths.rb
refinerycms-pages-0.9.9.3 features/support/paths.rb
refinerycms-pages-0.9.9.2 features/support/paths.rb
refinerycms-pages-0.9.9.1 features/support/paths.rb
refinerycms-0.9.9 pages/features/support/paths.rb