Why not doing something like

string_to_render = a.exists? ? a : b
render a

- Matt



On Tue, Mar 3, 2009 at 12:59 PM, Guyren G Howe <[email protected]> wrote:

>
> What's the most elegant way to do:
>
> if a exists
>        render a
> else
>        render b
> end
>
> ?
>
> I was going to write a helper that just relies on the exception, but I
> wondered if there was already a concise way to do this.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---

Reply via email to