Sha256: 3a06063a9e43d362c43306b64cac31e8d743e0177cd92164012454fb34c0d160

Contents?: true

Size: 309 Bytes

Versions: 3

Compression:

Stored size: 309 Bytes

Contents

class PagesController < InheritedResources::Base
  def resource
    page_id = params[:id] || Layout.current[:default_page]
    if page_id.is_numeric?
      @page ||= Page.find(page_id)
    else
      @page ||= Page.where(["lower(pages.title) = ?", page_id.downcase.gsub(/[_]/, ' ')]).first
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wheels-0.0.21 app/controllers/pages_controller.rb
wheels-0.0.20 app/controllers/pages_controller.rb
wheels-0.0.19 app/controllers/pages_controller.rb