Skip to content

Instantly share code, notes, and snippets.

@nerdyworm
Created April 13, 2011 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nerdyworm/917772 to your computer and use it in GitHub Desktop.
Save nerdyworm/917772 to your computer and use it in GitHub Desktop.
simple things
class Page
Pages = {
'/about/' => {
:title => 'About',
:template => '/pages/about/index.html.erb'
}
}
def self.find_by_path(path)
Pages[path].merge(:template => "/pages#{path}/index.html.erb"
end
end
puts Page.find_by_path('/about/')
# {:title=>"About", :template=>"/pages/about/index.html.erb"}
class Page
Pages = {
'/about' => {
:title => 'About',
}
}
def self.find_by_path(path)
Pages[path].merge(:template => "/pages#{path}/index.html.erb")
end
end
puts Page.find_by_path('/about')
# {:title=>"About", :template=>"/pages/about/index.html.erb"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment