Created
February 4, 2011 17:23
-
-
Save bmsolutions/811409 to your computer and use it in GitHub Desktop.
return false from filter
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
class ProfilesController < ApplicationController | |
before_filter :set_current_account | |
def index | |
@hours = BusinessHour.find_hours_for_id(@business.id) | |
@services = Service.find_services_for_business(@business.id) | |
@staffs = Staff.find_staff_for_business(@business.id) | |
respond_to do |format| | |
format.js | |
format.html | |
end | |
end | |
end | |
class ApplicationController < ActionController::Base | |
... | |
def set_current_account | |
Rails.logger.debug { "set_current_account" } | |
@business = Business.where( "lower(business_name) = ?", current_subdomain.downcase ).first | |
Rails.logger.debug { "@business: " + @business.nil?.to_s } | |
render_404 if @business.nil? | |
end | |
... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
class ProfilesController < ApplicationController
before_filter :set_current_account
def index
@Hours = BusinessHour.find_hours_for_id(@business.id)
@services = Service.find_services_for_business(@business.id)
@staffs = Staff.find_staff_for_business(@business.id)
end
end
class ApplicationController < ActionController::Base
...
def set_current_account
Rails.logger.debug { "set_current_account" }
@business = Business.where( "lower(business_name) = ?", current_subdomain.downcase ).first
Rails.logger.debug { "@business: " + @business.nil?.to_s }
render_404 && return false if @business.nil?
end
...
end