Write a helper that wraps image_tag that checks to see whether you are  
on your production box. Iff you are on the production box, then  
image_tag it is, otherwise, some placeholder image guaranteed to be  
local in your images dir.

Will that work?

On Jan 27, 2009, at 10:27 PM, william.hard...@gmail.com wrote:

>
> My development setup gets its data from our production database, and
> this production database refers to a bunch of images that aren't
> available on my local machine, thus when running development I get a
> large number of Rails RoutingErrors, which I don't really mind.
>
> What I *do* mind is that catching every one of these errors takes
> about 2-4 seconds, even with my quad-core desktop.  If I try to load a
> page with 5 missing images, it will probably be 20 seconds before I
> can visit another page.
>
> Has anyone else experienced this and thought up a clever workaround?
> I had hoped that using
>
> rescue_from(ActionController::RoutingError) { |e| render :nothing =>
> true }
>
> in my application controller would fix it, but it just serves to make
> the exception not print out its text.  It still takes the regular
> amount of time per image for the exception to be caught and ignored.
>
> Thank you greatly for any insights into how I might improve this.
> Bill
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to