Re: [Rails] Re: Showing 404 page from controller in Rails 3

2010-06-05 Thread Jeffrey L. Taylor
if render '/404.html' return end Quoting Legato : > I can't raise ActiveRecord::NotFound as that's not the ORM I am using, > so it is not even require'd in my project. Rendering 404.html should > work, but how do I halt the action additionally? raising an Exception > will prevent the rest o

[Rails] Re: Showing 404 page from controller in Rails 3

2010-06-03 Thread Legato
I can't raise ActiveRecord::NotFound as that's not the ORM I am using, so it is not even require'd in my project. Rendering 404.html should work, but how do I halt the action additionally? raising an Exception will prevent the rest of the action from executing, but rendering won't afaik. On Jun

Re: [Rails] Re: Showing 404 page from controller in Rails 3

2010-06-03 Thread Jeffrey L. Taylor
Try "raise ActiveRecord::NotFound" or "render '/404.html'". Jeffrey Quoting Legato : > What does one do when he's not using ActiveRecord? (Sequel here.) > > On Jun 1, 10:02 am, "Jeffrey L. Taylor" wrote: > > Raising.  In Rails 1.x and 2.x, ActiveRecord:NotFound exception is caught by > > Rails

[Rails] Re: Showing 404 page from controller in Rails 3

2010-06-03 Thread Legato
What does one do when he's not using ActiveRecord? (Sequel here.) On Jun 1, 10:02 am, "Jeffrey L. Taylor" wrote: > Raising.  In Rails 1.x and 2.x, ActiveRecord:NotFound exception is caught by > Rails and it displays the404page. > > HTH, >   Jeffrey > > Quoting Mirko : > > > Do you mean rescuing

Re: [Rails] Re: Showing 404 page from controller in Rails 3

2010-06-01 Thread Jeffrey L. Taylor
Raising. In Rails 1.x and 2.x, ActiveRecord:NotFound exception is caught by Rails and it displays the 404 page. HTH, Jeffrey Quoting Mirko : > Do you mean rescuing or raising ActiveRecord::NotFound? > > On Jun 1, 4:54 am, "Jeffrey L. Taylor" wrote: > > Quoting Joshua Partogi : > > > > > Hi a

[Rails] Re: Showing 404 page from controller in Rails 3

2010-06-01 Thread Joshua Partogi
Hi Jeff and Mirko, Thank you very much for the response. By default active_record will raise ActiveRecord::NotFound exception when a record can not be found in the database. And when this occurs, it will display the 404 page from the public folder. Unfortunately this hasn't been working for me in

[Rails] Re: Showing 404 page from controller in Rails 3

2010-06-01 Thread Mirko
Do you mean rescuing or raising ActiveRecord::NotFound? On Jun 1, 4:54 am, "Jeffrey L. Taylor" wrote: > Quoting Joshua Partogi : > > > Hi all, > > > I want to be able to display 404 page from a controller when a record > > in the database can not be found. I am using Rails 3 at the moment. I > >