Skip to content

Instantly share code, notes, and snippets.

@JoeWoodward
Created December 22, 2011 16:09
Show Gist options
  • Save JoeWoodward/1510827 to your computer and use it in GitHub Desktop.
Save JoeWoodward/1510827 to your computer and use it in GitHub Desktop.
class StaticPagesController < ApplicationController
def info
@favorite_links = Link.where(:favourite => true)
@links = Link.where(:favourite => false)
render 'info'
end
def contact
if request.subdomain.present?
@section = User.where(:role_ids == Role.find_by_name(request.subdomain).id)
@sections = [@section]
else
@stpancras_users = User.where(:role_ids == Role.find_by_name('stpancras').id)
@stmarys_users = User.where(:role_ids == Role.find_by_name('stmarys').id)
@stpauls_users = User.where(:role_ids == Role.find_by_name('stpauls').id)
@stmichaels_users = User.where(:role_ids == Role.find_by_name('stmichaels').id)
@sections = [@stpancras_users, @stmarys_users, @stpauls_users, @stmichaels_users]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment