Displaying 15 results from an estimated 15 matches for "local_request".
2005 Jan 11
7
default error page
Help, please.
I need redirection to a custom error page, instead of
the default Rails messages (e.g. Unknown action).
I use WebRick, no Apache, and i think i can''t use
public/.htaccess (# General Apache options).
Thanks.
___________________________________
Nuovo Yahoo! Messenger: E'' molto più divertente: Audibles, Avatar, Webcam, Giochi, Rubrica
Scaricalo ora!
2006 Feb 03
2
testing to see if emails are sent out on exceptions
Hi,
I''m using ActionController::rescue_action_in_public() to send emails
when uncaught exceptions happen.
Is it possible to write tests for that?
Joe
2010 Jul 26
2
Exception Pages when behind a proxy
I am not sure if this desired feature or not but when we are behind a
local proxy ie. Nginx/Varnish then the new ShowException middleware
doesn''t seem to properly detect the remote IP address and it appears
as if every browser gets a local error page with a stack trace, etc.
I''ve opened up a ticket on the rails bug tracker but I also would like
to verify that this is in fact a
2009 Feb 04
2
rendering error page for "Unauthorized" from before_filter
..." text being
rendered.
I also went into the rails source and tweaked the rescue module a bit
so that I surely get the ''public'' view of the exception:
def rescue_action_without_handler(exception)
(...)
if false && (consider_all_requests_local || local_request?) #
here
rescue_action_locally(exception)
else
rescue_action_in_public(exception)
end
(...)
That did not change anything, either. Am I not doing the proper thing?
Should I throw an exception (which one?) instead of rendering
something and setting the http s...
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 local_request?
false
end
Also, I altered the environments files so I won''t get the standard
developer error messages (although this seems like possible ove...
2007 Oct 11
0
Custom rescue_action_* methods not being called?
...nts inside of the ActionController Rescue
module to verify that rescue_action is being called.
Here are my overrides in application.rb, none of which are being called
- they are all protected visibility (these are just for debugging
purposes, so please no comments on how dumb they look ;]):
def local_request?
puts "Calling custom local_request method"
false
end
def rescue_action_locally(exception)
puts "Calling custom rescue locally method"
end
def rescue_action_in_public(exception)
puts "rescue_action custom called"
render :text => "&...
2006 Feb 11
5
Strange messages in "congratulations" mode
Hi All..
First off, I thought I''d let you know that im UBER new at ruby, so what
im asking you may have a really simple answer...
Anyway, i just started using RoR and i''ve set it up on OSX, running
Apache2.
It all goes fine and dandy, I get the "Welcome aboard" page to say that
its all setup and running ok, but when I click on "About your
applications
2006 Mar 14
7
Application error (Rails)
After I attempted to add ActionMailer functionality, it gave the
"Application error (Rails)" and now, everything on my site works, except
for the part where the Actionmailer ''would have'' sent the email.
I took that out now, re-uploaded the file, and ran "killall -USR1
dispatch.fcgi" and still nothing. Everything else works, except that.
Any idea what
2007 Jan 06
6
Exception notifier not working
...st the
standard error template that I always get when there is an error.
I''ve restarted the server countless times to no avail, and to
short-circuit the fact that I''m running the server and making page
requests locally, I commented out the code in ExceptionNotifiable as
such:
def local_request?
# remote = IPAddr.new(request.remote_ip)
# !self.class.local_addresses.detect { |addr| addr.include?(remote)
}.nil?
false
end
...and I''ve also tried:
def local_addresses
''addresses = read_inheritable_attribute(:local_addresses)
unless addresses
addresses...
2006 Feb 16
0
rescue_action_in_public in development environment?
...he rendered
"ERROR." Similarly, specifying a non-existant action in a URL
gives an "Unknown Action" error.
I''m guessing this a result of being in development environment
(which I am). I know you can specify an IP as a developer machine
in production mode via ''local_request?'', but how about the other
way around?
2006 Sep 02
1
custom error handling
Please forgive me if this is a stupid question. If it has been
answered already, please point me to the answer, as my searching has
been fruitless.
How can I programatically handle 404s and 500s when using Mongrel?
I''ve read about using a proxy server config (.htaccess for example) to
render an ErrorDocument rather than whatever comes from Rails, but I
need something different. I would
2006 Mar 17
7
OT: Subversion folder cleanup
How do you clean up your app folder to place onto the server? I want to
get rid of all the .svn stuff.
Seth Buntin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060317/cc81d9f7/attachment.html
2010 Jun 03
7
Scheduled tasks in Rails: Cron + wget = Best solution?
Hi there,
do you agree that for having scheduled tasks in Rails, the leanest
solution is the following?
- Create a controller with an action for each task
- Implement the logic of the task as controller code
- Set up a cron job at the OS level that uses wget to invoke the URL of
this controller/action at the appropriate time intervals
Advantages:
1) full access to all your Rails objects just as
2006 Feb 17
16
Booking system
Hi!
I''m planning a booking system in rails, and I have the following issue:
There will be room_types. I can implement this with STI in the rooms
table, or with a separate table room_types. Each room type will have its
special features.
For example, a double room can be:
--
Posted via http://www.ruby-forum.com/.
2008 Mar 08
9
Validation error handling on related models
I have 2 models, entity and client. Entity has_one client and client
belongs_to entity.
Entity has attributes name and legal_name. Entity also has an unique
index on (lower(name)). The pKey for both is the conventional Rails id.
Client has a fKey constraint on entity_id and is indexed in entity_id.
In controllers/clients_controller.rb I have:
# GET /clients/new
# GET /clients/new.xml