Skip to content

Instantly share code, notes, and snippets.

@swr
Created August 2, 2010 22:27
Show Gist options
  • Save swr/505435 to your computer and use it in GitHub Desktop.
Save swr/505435 to your computer and use it in GitHub Desktop.
class HomeController < ApplicationController
def index
# render the landing page
redirect_to root_url
end
def show
if params[:page].nil? || params[:page] == :home
render :action => :home
else
render :action => params[:page]
end
end
end
ActionController::Routing::Routes.draw do |map|
# static pages
map.home ':page', :controller => 'home', :action => 'show', :page => /about|terms|privacy|home/
# default
map.root :home
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment