So you have a boolean check in your database and you want to convert the output from saying "true" or "false" to something more readable like "yes" or "no". It's as easy as:
<%= article.show? ? 'yes' : 'no' %>
Where article is the object and show is the field in my database with the boolean 1 or 0 stored.
Comments left...
Please, con you check the article? the code is not avaiable.
Pepe at 26 Sep 07 at 08:08
Hi Pepe,
The code is there, it reads:
article.show? ? 'yes' : 'no'Can you see the code in the html source? Perhaps there is a css bug here? What browser are you using?
Thanks,
Paul.
Paul at 26 Sep 07 at 08:31
Thanks so much! I was going crazy trying to figure this out. Sometimes the API and I are speaking different languages…
It worked perfectly in my application.
Chris B at 30 Jan 08 at 14:04
No prescription needed! reductil without prescription reductil no prescription reductil sale meridia without prescription meridia no prescription meridia sale clonazepam without prescription clonazepam no prescription clonazepam sale klonopin without prescription klonopin no prescription klonopin sale xenical without prescription xenical no prescription xenical sale ativan without prescription ativan no prescription ativan sale cialis without prescription cialis no prescription cialis sale
None at 11 Jul 09 at 23:06
Articles Archive →
Got something to say?