-
-
Save strikyflo/6c531a3803eda2367d03 to your computer and use it in GitHub Desktop.
This file contains 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
class Page < ActiveRecord::Model | |
scope :by_permalink, -> { |permalink| where(:permalink => permalink) } | |
def content_data | |
Oj.load(content) | |
end | |
def self.find_by_permalink(permalink) | |
by_permalink(permalink).first | |
end | |
end | |
class PagesController < ApplicationController | |
def show_static | |
# code to retrieve the correct subdomain | |
@page = Page.find_by_permalink(subdomains.first) | |
@feature = Feature.new(@page.user) | |
@data = @page.data_content # usually we change some of the content but it's been deactivated | |
render :show, :layout => 'show', :formats => [:html] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment