rosa-build/app/controllers/application_controller.rb

20 lines
397 B
Ruby
Raw Normal View History

2011-03-09 13:13:36 +00:00
class ApplicationController < ActionController::Base
protect_from_forgery
layout :layout_by_resource
protected
def layout_by_resource
if devise_controller?
"sessions"
else
"application"
end
end
2011-04-11 13:56:22 +01:00
def authenticate_by_ip!
if request.remote_ip != APP_CONFIG['auth_by_ip']
render :nothing => true, :status => 403
end
end
2011-03-09 13:13:36 +00:00
end