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
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
> 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
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
4 matches
Mail list logo