Displaying 2 results from an estimated 2 matches for "deny_access".
Did you mean:
delay_access
2007 Dec 22
8
Rails 2.0 rescue_from
I am trying to use the new Rails 2.0 macro : rescue_from
class PostsController < ApplicationController
rescue_from ActiveRecord::RecordNotFound, :with => :deny_access
...
def show
@post = Post.find_by_id(params[:id])
raise ActiveRecord::RecordNotFound if @post.nil? #illegal access
.....
end
def deny_access
respond_to do |format|
format.html
end
end
but the exception is not raised ... did I miss something ?
thanks
kad
--
Posted...
2011 Jan 03
8
Heroku, needs constant AppController updates?
...on Controller
class ApplicationController < ActionController::Base
require ''date''
require ''nokogiri''
require ''open-uri''
require ''chronic''
protect_from_forgery
include SessionsHelper
def authenticate
deny_access unless signed_in?
end
def find_all_events
@event_searches = EventSearch.all
@event_searches.each do |es|
do_search(es)
end
end
def find_one_band_events(event_id)
es = EventSearch.where(:id => event_id)[0]
do_search(es)
end
def do_search(event_search)
logger.debug&q...