[Rails] Re: Possible to get random translation?

2010-04-15 Thread Kevin Skoglund
It would help to know what your larger goal is, but here's a simple version: DICTIONARY = { "hello" => ["Hello!", "Howdy!", "G'day!"], "goodbye" => ["Goodbye!", "Later!"] } def random_t(string) variants = DICTIONARY[string] variants ? variants.rand : nil end random_t("hello") random_t("g

[Rails] Re: Ruby training? Worry no more.

2009-05-13 Thread Kevin Skoglund
Garfeee, Thanks for the kind words and recommendation. Ruby on Rails Essential Training is being updated for Rails v3 and I'll be releasing a separate Ruby Essential Training soon. Best, Kevin --~--~-~--~~~---~--~~ You received this message because you are subscr

[Rails] Re: Your thoughts on "Enterprise Rails"

2008-12-29 Thread Kevin Skoglund
> Firstly, he advocates you organize your application deeper than the   > default Rails skeleton; for example he says to put all of your models   > under a "physical" directory (e.g. app/models/physical) and to   > separate them by module (e.g. Physical::Projects::Project). I would agree that org

[Rails] Re: Help in writing unit test cases

2008-11-27 Thread Kevin Skoglund
Sumanth, I wrote a series of blog posts that might help demystify unit testing for you. It starts here: http://www.nullislove.com/2007/11/10/testing-in-rails-introduction/ HTH, Kevin --~--~-~--~~~---~--~~ You received this message because you are subscribed to th