Forum: Ruby on Rails AWDWR: NameError (uninitialized constant UnknownAction) in r

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
81194a50c0f9bd95d7832a77fdf371bd?d=identicon&s=25 CSN (Guest)
on 2006-02-07 04:51
(Received via mailing list)
I copied (and modified) this code from AWDWR:

def rescue_action_in_public(exception)
	case exception
		when ActiveRecord::RecordNotFound,
ActionController::UnknownAction
			render :template=>'/error', :layout=>'application',
:status=>'404 Not Found'
		else
			render :template=>'/error', :layout=>'application',
:status=>'500 Error'
	end

	Notifier.deliver_exception(self, request, exception)
end

It works, except when an 'unknown action' occurs, then
it displays this in the log:

NameError (uninitialized constant UnknownAction):

/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.4/lib/active_support/dependencies.rb:200:in
`const_missing'
  .//app/controllers/application.rb:63:in
`rescue_action_in_public'


Any idea what the problem is?

Thanks
csn


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2006-02-09 11:13
(Received via mailing list)
CSN wrote:
> :status=>'500 Error'
> 
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.4/lib/active_support/dependencies.rb:200:in
> `const_missing'
>   .//app/controllers/application.rb:63:in
> `rescue_action_in_public'

Try ::ActionController::UnknownAction

--
We develop, watch us RoR, in numbers too big to ignore.
This topic is locked and can not be replied to.