Sha256: 473a98d9a7382b4a26e8bce84a3cb22800e9af9afe77b43412097696c56721bf

Contents?: true

Size: 595 Bytes

Versions: 22

Compression:

Stored size: 595 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.by_title($1).first).present?
              self.url_for(page.url)
            else
              nil
            end
          rescue
            nil
          end
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
refinerycms-pages-1.0.9 features/support/paths.rb
refinerycms-pages-1.0.8 features/support/paths.rb
refinerycms-pages-1.0.7 features/support/paths.rb
refinerycms-pages-1.0.5 features/support/paths.rb
refinerycms-pages-1.0.4 features/support/paths.rb
refinerycms-pages-1.0.3 features/support/paths.rb
refinerycms-pages-1.0.1 features/support/paths.rb
refinerycms-pages-1.0.0 features/support/paths.rb
refinerycms-pages-0.9.9.22 features/support/paths.rb
refinerycms-pages-0.9.9.21 features/support/paths.rb
refinerycms-pages-0.9.9.20 features/support/paths.rb
refinerycms-pages-0.9.9.19 features/support/paths.rb
refinerycms-pages-0.9.9.18 features/support/paths.rb
refinerycms-pages-0.9.9.17 features/support/paths.rb
refinerycms-pages-0.9.9.16 features/support/paths.rb
refinerycms-pages-0.9.9.15 features/support/paths.rb
refinerycms-pages-0.9.9.14 features/support/paths.rb
refinerycms-pages-0.9.9.13 features/support/paths.rb
refinerycms-pages-0.9.9.12 features/support/paths.rb
refinerycms-pages-0.9.9.11 features/support/paths.rb