Displaying 20 results from an estimated 3000 matches similar to: "ActionController::UnknownAction hangs application"
2006 Feb 16
3
rescue_action_in_public question
I''m using the rescue_action_in_public example from the Agile book to
handle errors and email serious ones to me. In my application.rb
controller:
def rescue_action_in_public(exception)
logger.error("rescue_action_in_public executed")
case exception
when ActiveRecord::RecordNotFound, ActionController::RoutingError,
ActionController::UnknownAction
2006 Nov 08
0
routing error does not get caught by rescue_action_in_public
I have this in my application controller.
def rescue_action_in_public(exception)
logger.error("rescue_action_in_public executed")
case exception
when ActiveRecord::RecordNotFound,
::ActionController::UnknownAction,
::ActionController::RoutingError
logger.warn("rendering 404 page")
render(:file =>
2006 Feb 07
1
AWDWR: NameError (uninitialized constant UnknownAction) in rescue_action_in_public
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'',
2006 Mar 07
17
Handling Erros from AWDWR
I''m getting to the point now where I really need to start trapping the
errors.
So from my AWDWR book, I added the following directly from the book into
application.rb...
def rescue_action_in_public(exception)
case exception
when ActiveRecord::RecordNotFound, ActionController::UnknownAction
render(:file => "#{RAILS_ROOT}/public/404.html",
2006 Sep 01
0
Why prefix ActionController::UnknownAction with ::?
In my application.rb''s rescue_action_in_public, why do I need to prefix
ActionController::UnknownAction with ::, when
ActiveRecord::RecordNotFound (no :: prefix) works? If I don''t prefix the
former, I get an unknown constant (or similar) error.
Joe
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message
2006 Feb 08
2
NameError (uninitialized constant UnknownAction)
Hi, I''m having a strange problem that only seems to be happening on our
production server. I never get this error locally but get it quite
often on the server. The other odd thing is it doesn''t seem to be
resulting in any error pages on the site. Everything looks fine...
I wanted to add a rescue_action_in_public to email me when there are
errors. So I followed the
2007 Jan 20
1
Missing action error not being caught
I keep getting a blank page containing only the following:
"There was a controller specfic error processing your request."
Though I have the following in my application.rb
def rescue_action_in_public(exception)
case exception
when UnknownAction, ActiveRecord::RecordNotFound then
render :controller => "application", :action =>
2007 Sep 08
1
Unknown Action doesn't raise exception ?
As I am in development environment, I wrote in my config/environment.rb
ActionController::Base.consider_all_requests_local = false
in my application.rb, I wrote
def rescue_action_in_public(exception)
case exception
when RoutingError, UnknownAction
render :file => "#{RAILS_ROOT}/public/404.html", :status =>
404
else
logger.error
2009 Aug 07
4
ActionController::UnknownAction (No action responded to 22.
I try to switch my application from Rails 2.2.2 to Rails 2.3.3.
In namespace :admin I have a resource-based controller. See controller
class Admin::OSystemsController < Admin::BaseController
def index
.......
end
def edit
.........
end
def update
..........
end
end
Resource is added to routes.rb like
map.namespace :admin do |admin|
............
admin.resources :o_systems,
2010 Aug 08
2
issue with rescue_action_in_public! and testing 404 responses
Hello,
I''m new to rails and I''m trying to wrap my heads around how to spec
controllers using RSpec (using rails 3rc1 and rspec 2.0.0.beta.19).
The problem I''ve run into is when I want to test that my controllers respond
with a 404 for unfound records.
Whenever I run the spec, the ActiveRecord::RecordNotFound exception is not
caught by rails, causing the spec
2006 Jun 07
3
ActionController::UNKnownAction (No action responded to crea
Hello All,
I''ve developed RoR on windowsXP have deployed that on Linux. Everythings
works fine when working on windows. Things are fine on Linux too untill
I try to create new entry. I tried but couldn''t find any relevent
information why it should happen only to this "specific" create action.
I''m saying this because different create on other forms are
2007 Jan 15
5
ActionController::UnknownAction (No action responded to xxx)
I have a new method defined in a existing controller.
All the methods I called in these are workable.
But somehow the new method is not recognizable.
------------------new method I
added--------------------------------------------
def push
# if fair
begin
@product = Product.find(params[:id])
rescue
logger.error("Attempt to access invalid product #{params[:id]}")
2005 Dec 16
1
Exception Locations?
I am trying to locate the following in the current 1.0 source tree:
ActiveRecord::RecordNotFound
ActionController::UnknownAction
Looking at the API docs, I''ve been unable to track these down.
Can someone help?
2007 Jan 11
0
writing tests for rescue_action_in_public
I''m having trouble with rescue_action_in_public, both in getting it
to work right in my rails app, and in writing tests to make sure.
What I ultimately want to do is test for what a normal user would see
when an error is trapped.
I override local_request? like so:
application.rb
--------------
def rescue_action_in_public(exception)
render :text => "oops"
end
def
2008 Mar 04
2
Action Mailer throwing underscores on template name
I''ve recently run into a problem with one of my applications that
refuses to send emails using ActionMailer.
Looking at the log, it become obvious what''s happening, the system is
looking for templates with underscores at the end. Notice the
exception_notification_ .
For example:
ActionView::ActionViewError (No rhtml, rxml, rjs or delegate template
found for
2008 May 11
2
UnKnownAction exception
Hi all,
i''m new in ruby on rails.
i created a controller which has 2 views index, add_to_cart
& inside index i created "button_to" which references to add_to_cart
view, but when i click on this button UnKnownAction exception appear
to me, i don''t know why this happen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are
2008 Feb 13
5
Example controller spec no worky?
I''m trying to spec a dead simple "show non-existent record should render
404" case, but it seems the RecordNotFound exception is making it
impossible for some reason.
#controller
def show
@event = Event.find(params[:id])
end
#spec - pretty much straight from the rspec site
before do
Event.stub!(:find)
get :show, :id => ''broken''
end
#
2006 Jun 30
1
Taking Control of Un-handled Exceptions
Greetings,
I''m trying to catch all un-handled exceptions. I''m having problems
handling the RoutingError and UnknownAction exceptions.
I''ve added the following to my application controller as a protected
method:
def rescue_action(exception)
render(:text => "error")
end
As far as I understand, this should catch all uncaught exceptions and
override
2005 Dec 18
2
Default routes for unknown actions
Hi folks-
I have the following map for default ''junk'' routes:
map.connect ''*anything'', :controller => ''welcome'', :action =>
''unknown''
Which works just fine for a URL like: "mysite.com/junkjunkjunk"
However, it still tries to resolve an action when I do:
"mysite.com/my_controller/junkjunkjunk"
2010 Aug 09
0
Exceptions in functional tests (rescue_action_in_public! broken?)
In 2.3, exceptions raised by controllers under functional tests were by
default propagated to the test, but by using rescue_action_in_public! a test
could trigger the production, public behavior and then use assert_response
or similar to test the expected result. This was implemented via
coordination between ActionController::Rescue and
ActionController::TestCase::RaiseActionExceptions.
This