Skip to content

Instantly share code, notes, and snippets.

@bishopandco
Created May 21, 2012 21:24
Show Gist options
  • Save bishopandco/2764827 to your computer and use it in GitHub Desktop.
Save bishopandco/2764827 to your computer and use it in GitHub Desktop.
class MainController < ApplicationController
include Cable::Helpers::CableControllerHelpers
# def find_by_url
# unless request_is_missing_static_resource?
# @location = Location.includes(:menus).find_by_marketable_url( params[:url] ) || Location.includes(:menus).find_by_url( request.path )
# unless @location.nil?
# @resource = @location.resource
# @page_title = (@location.title.nil?) ? "" : @location.title
# send(@location.special_action) unless @location.special_action.blank?
# @continue_execution = send(@location.special_action) unless @location.special_action.blank?
# render :action => :show, :layout => "internal" if @continue_execution || @continue_execution.nil?
# else
# logger.warn "[Cable::MissingLocation] No location found for /#{params[:url]}. Redirecting to root.".color(:red)
# redirect_to "/" and return false
# end
# else
# render :nothing => true, :status => 403
# end
# end
# before_filter :find_by_url_mask
# def find_by_url_mask
#
# masked_resources = UrlMask.find_resource_by_url( request.path )
# prepare_variables_for_masked_resources( masked_resources ) unless masked_resources.empty?
#
# end
def work
end
def blog
@posts = Post.order('created_at DESC').page(params[:page]).per(3).@posts = Post.order('created_at DESC').page(params[:page]).per(3).@posts = Post.order('created_at DESC').page(params[:page]).per(3)
@page_title = "Blog"
respond_to do |format|
format.html
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment