Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #4687

Re: Ruby/Sinatra - Variable inside erb calls

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!feeds.phibee-telecom.net!talisker.lacave.net!lacave.net!not-for-mail
From 7stud -- <bbxx789_05ss@yahoo.com>
Newsgroups comp.lang.ruby
Subject Re: Ruby/Sinatra - Variable inside erb calls
Date Tue, 17 May 2011 14:16:59 -0500
Organization Service de news de lacave.net
Lines 14
Message-ID <796f35470268b3a40b164d45fc480fce@ruby-forum.com> (permalink)
References <69d0c8c5a3b8782605829508018eef60@ruby-forum.com> <7011113ad9646a11b7fef0900f1ee153@ruby-forum.com>
NNTP-Posting-Host bristol.highgroove.com
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace talisker.lacave.net 1305659841 30887 65.111.164.187 (17 May 2011 19:17:21 GMT)
X-Complaints-To abuse@lacave.net
NNTP-Posting-Date Tue, 17 May 2011 19:17:21 +0000 (UTC)
In-Reply-To <7011113ad9646a11b7fef0900f1ee153@ruby-forum.com>
X-Received-From This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway
X-Mail-Count 383397
X-Ml-Name ruby-talk
X-Rubymirror Yes
X-Ruby-Talk <796f35470268b3a40b164d45fc480fce@ruby-forum.com>
Xref x330-a1.tempe.blueboxinc.net comp.lang.ruby:4687

Show key headers only | View raw


Eugen Ciur wrote in post #999234:
>
> (drop ':' operator, it is not necessary).
>

According to the Sinatra docs, it must be a symbol.

So I would just use string interpolation:

  erb :"templates/#{style}/layout"

-- 
Posted via http://www.ruby-forum.com/.

Back to comp.lang.ruby | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: Ruby/Sinatra - Variable inside erb calls Eugen Ciur <ciur.eugen@gmail.com> - 2011-05-17 06:34 -0500
  Re: Ruby/Sinatra - Variable inside erb calls 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-17 14:16 -0500

csiph-web