[Rails] Re: Object#send takes 10 seconds to complete

2010-01-17 Thread Liam Morley
Robbie, http://www.khelll.com/blog/ruby/ruby-dynamic-method-calling/ mentions a few different ways to call a method dynamically, and http://lojic.com/blog/2008/12/22/ruby-dynamic-method-invocation-performance/ talks about performance. I'd try instantiating the method and then calling it, see what h

[Rails] Re: DRYing up helper

2010-01-17 Thread Liam Morley
pepe, you should be able to use eval(section.upcase + '_FIELDS') instead of constantize. That being said, I can never suggest using eval unless I accompany that with a warning, a la http://www.railsrocket.com/articles/the-controversial-eval-function. Also, I always valued readability over being D

[Rails] some routes don't load in production

2010-01-17 Thread Liam Morley
This one is really tricking me out. I've made a minimal sample app that reproduces the problem I'm facing, it's at http://github.com/carpeliam/plogger_ts_devise_problem_example. Some minimal explanation is there as well, the rest of this note is both backstory and elaboration. I'm developing a blog

[Rails] how to represent join tables with Rails 2.3 nested attributes?

2009-03-19 Thread Liam Morley
I have a model Store with a relationship Address. Because multiple models have relationships to Address, I have a addresses_stores join table with a corresponding StoreAddress class that contains information specific to that store/address (store hours, phone #, etc). This seemed like the way to g

[Rails] Re: What to do when a user logs out, then presses the back button?

2008-11-24 Thread Liam Morley
On Mon, Nov 24, 2008 at 4:30 AM, Frederick Cheung < [EMAIL PROTECTED]> wrote: > > 2. the user presses the "back" button and goes to a public page >> >> The data in this case is not sensitive, but because Rails forms use >> authenticity tokens that are tied to the session, the session becomes >> in

[Rails] What to do when a user logs out, then presses the back button?

2008-11-23 Thread Liam Morley
There are two cases I'm concerned about here when a user logs out, then clicks the back button: 1. the user presses the "back" button and goes back to a page that would otherwise require authentication Right now, the existing page is still kept in cache, so private data is still being seen. I'm