I’m using rescue_from in my controller, but now I don’t see the exceptions in Hoptoad. Whazzup with that?
Hoptoad uses alias_method_chain to hook into the rescue_action_in_public method.
# Overrides the rescue_action method in ActionController::Base,
# but does not inhibit any custom processing that is defined
# with Rails 2's exception helpers.
def rescue_action_in_public_with_hoptoad exception
notify_hoptoad(exception) unless ignore?(exception)
The rescue_from system in Rails actually catches the exceptions before rescue_action_in_public happens. The upshot is that if you want to see those exceptions in Hoptoad, you’ll need to explicitly send them along in your rescue_from method using notify_hoptoad(exception):
The RHG is a book that explains how the ruby interpreter (the official C implementation of the Ruby language) works internally.
It is partially translated from Japanese. Official RHG contains only 4 chapters.
The IRHG Project has been significantly improved by the integration of the Ruby Forge Translation Documents. The two projects have been merged and have provided a improved format, especially with the addition of color graphics.
All front-end pages and chapters 1 through 10, and chapter 18 have been completed.
Chapter11 is partially completed.
Part of chapter 11, chapters 12 through 17, and chapters 19 and 20 are presently in machine translated form. Due to the use of Google Translation API’s, these are much more readable than previously.
All of the credit card numbers below are randomly generated numbers. In addition, none of the credit card numbers has the same last four digits as any other credit card number. This ensures that when you select a credit card to complete an order, you can easily associate a test credit card with a particular test
Replace the stupid fieldWithErrors <div> with a <span>. YES, I know you can make DIVs inline by applying a “display: inline” style; the real problem is that you can’t simply use DIVs anywhere. Most significantly, you can’t use DIVs inside a P, which would be invalid HTML and in fact confuses some browsers more than you’d like.
As mentioned above, the creation of tracker objects is implied. They are created the first time you use them. The examples above only show how to used the default tracker object. If you need more tracker objects, you must prepend a unique name to the method name of each command array you push for non-default trackers. For example, the following code sets the account and calls _trackPageview() for the default tracker; then it does the same thing for a second and third tracker.
This chapter on what to do “When Things Go Wrong” turned out to be one of the most enjoyable ones to write. Having a strong ability to troubleshoot and debug code is a powerful skill to have, and I do my best to share all my secrets here.
A while ago, I came across a unique registration form built by Jeremy Keith for his audio sharing site, Huffduffer […]
I was curious how it would perform against a traditional form. Would people be more inclined to complete it because of the narrative format? Or would the unfamiliar presentation format confuse people? […] I now have some early answers. […]
Mad Libs style forms increased conversion across the board by 25-40%.
For me, I absolutely hate all this encoding stuff in ruby 1.9, and I’ll try to explain why here.
In ruby 1.8, if I write an expression like “s3 = s1 + s2”, where s1 and s2 are strings, this is easy because it’s a one-dimensional space. As long as s1 and s2 are strings, then I know that s3 will be a string, consisting of the bytes from s1 followed by the bytes from s2. End of story, move to the next line.
But in ruby 1.9, it becomes a multi-dimensional problem. The number possibilities now explodes. What are the possible encodings that s1 might have at this point in the program? What are the possible encodings that s2 might have at this point? Are they compatible, or will an exception be raised? What encoding will s3 have going forward in the next line of the program?
It’s ridiculously complicated. string19.rb contains around 200 examples of behaviour, and could form the basis of a small book. It’s a +String+ for crying out loud! What other language requires you to understand this level of complexity just to work with strings?!…
Ambitious Query Indexer is a Rails plugin to identify database indexes that are missing. Rather than looking at tables and guessing what needs indexing, it will locate and run as many queries as it can find and suggest indexes that could be added based upon its finding.