Created
June 17, 2011 14:17
-
-
Save jonpaul/1031496 to your computer and use it in GitHub Desktop.
Returns 'could not find page with ID=page-title'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def to_param | |
"#{title.downcase.gsub(/[^a-zA-Z0-9]+/, '-').gsub(/-{2,}/, '-').gsub(/^-|-$/, '')}" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def show | |
@page = Page.find(params[:id]) | |
respond_to do |format| | |
format.html # show.html.erb | |
format.xml { render :xml => @page } | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources :pages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment