Sha256: 0ef3fc5079a0da9387f09f35ec84b2c4c54755d673a22d05c0c0456bfeae3dfa

Contents?: true

Size: 335 Bytes

Versions: 4

Compression:

Stored size: 335 Bytes

Contents

module NavigationHelpers
  def path_to(page_name)
    case page_name

    when 'the homepage'
      root_path

    when /^the ([\w ]+) page$/
      send("#{$1.gsub(/\W+/, '_')}_path")

    when /^"(\/.*)"/
      $1

    else
      raise "Can't find mapping from \"#{page_name}\" to a path."
    end
  end
end

World(NavigationHelpers)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
terraformation-0.2.2 rails_generators/terraformation/templates/paths.rb
terraformation-0.2.1 rails_generators/terraformation/templates/paths.rb
terraformation-0.2.0 rails_generators/terraformation/templates/paths.rb
terraformation-0.1.3 rails_generators/terraformation/templates/paths.rb