I want to programmatically under certain conditions return a 404 (page not found) error to the browser. How can I do this from my controller? I''m assuming I need to set a header on the reponse obect. However I can''t figure out what the header name is. thanks, scott. -- Posted via ruby-forum.com.
Greetings Scott Yep, you''re right response.headers["Status"] = "404" cheers, Jodi On 2-Apr-06, at 10:33 PM, Scott F. Walter wrote:> I want to programmatically under certain conditions return a 404 (page > not found) error to the browser. How can I do this from my > controller? > > I''m assuming I need to set a header on the reponse obect. However I > can''t figure out what the header name is. > > thanks, scott. > > -- > Posted via ruby-forum.com. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > lists.rubyonrails.org/mailman/listinfo/rails
Is something preventing... render :nothing => true, :status => 404 ...from being apropos? On 4/2/06, Scott F. Walter <tx_scottwalter@yahoo.com> wrote:> I want to programmatically under certain conditions return a 404 (page > not found) error to the browser. How can I do this from my controller? > > I''m assuming I need to set a header on the reponse obect. However I > can''t figure out what the header name is. > > thanks, scott. > > -- > Posted via ruby-forum.com. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > lists.rubyonrails.org/mailman/listinfo/rails >
Scott F. Walter
2006-Apr-03 13:13 UTC
[Rails] Re: How do I programmatically send a 404 error
Edward Frederick wrote:> Is something preventing... > > render :nothing => true, :status => 404 > > ...from being apropos?ahh. Much, more,elegant! -- Posted via ruby-forum.com.