# What is this view syntax? Old beast forum code

**URL:** <https://www.ruby-forum.com/t/what-is-this-view-syntax-old-beast-forum-code/176437>\
**Category:** Rails\
**Created:** [September 30, 2009, 3:30pm UTC](https://www.ruby-forum.com/t/what-is-this-view-syntax-old-beast-forum-code/176437 "2009-09-30T15:30:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [September 30, 2009, 3:30pm UTC](https://www.ruby-forum.com/t/what-is-this-view-syntax-old-beast-forum-code/176437/1 "2009-09-30T15:30:07Z")

</div>

Hey folks

A long time ago, before i started working at this company, we used a  
Beast forum. The beast code (models, controllers and views) were all  
just lumped in with our app code, but when we moved to a new version  
(about a year and a half ago) the forum section of our site was closed  
off (simply by not linking to it anywhere).

I’ve been tasked with resurrecting it, and the first problem i’m seeing  
is code like this in the views:

```
<%= '{count} topic(s)'[(count=Topic.count)==1 ? :topic_count :

```

:topics\_count, number\_with\_delimiter(count)] %\>,

or

\<%= submit\_tag ‘Save Forum’[:save\_forum], :or =\>  
link\_to(‘Cancel’[:cancel], forums\_path) %\>

My first thought was “wtf is that?”, and it’s that question that i put  
to you, dear readers.

max

---

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [September 30, 2009, 5:03pm UTC](https://www.ruby-forum.com/t/what-is-this-view-syntax-old-beast-forum-code/176437/2 "2009-09-30T17:03:44Z")

</div>

On Sep 30, 2009, at 6:30 AM, Max W. wrote:

> \<%= ‘{count} topic(s)’[(count=Topic.count)==1 ? :topic\_count :  
> :topics\_count, number\_with\_delimiter(count)] %\>,
> 
> or
> 
> \<%= submit\_tag ‘Save Forum’[:save\_forum], :or =\>  
> link\_to(‘Cancel’[:cancel], forums\_path) %\>
> 
> My first thought was “wtf is that?”, and it’s that question that i put  
> to you, dear readers.

Looks like a stab at L10N. I bet “string”[:symbol] is a way to have  
‘reasonable’ strings embedded in the code, but still look 'em up in a  
translation table.

~ j.

---

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [September 30, 2009, 5:08pm UTC](https://www.ruby-forum.com/t/what-is-this-view-syntax-old-beast-forum-code/176437/3 "2009-09-30T17:08:57Z")

</div>

John B. wrote:

> On Sep 30, 2009, at 6:30 AM, Max W. wrote:
> 
> > \<%= ‘{count} topic(s)’[(count=Topic.count)==1 ? :topic\_count :  
> > :topics\_count, number\_with\_delimiter(count)] %\>,
> > 
> > or
> > 
> > \<%= submit\_tag ‘Save Forum’[:save\_forum], :or =\>  
> > link\_to(‘Cancel’[:cancel], forums\_path) %\>
> > 
> > My first thought was “wtf is that?”, and it’s that question that i put  
> > to you, dear readers.
> 
> Looks like a stab at L10N. I bet “string”[:symbol] is a way to have  
> ‘reasonable’ strings embedded in the code, but still look 'em up in a  
> translation table.
> 
> ~ j.  
> hmm, yeah, you may be on to something there, John.

hahahaha no way, just googled “beast forum localization” -  
hahahahahahaha
