From: Jano Svitok Date: 2008-06-06T17:08:14+09:00 Subject: Re: erb question --urgent help needed? On Fri, Jun 6, 2008 at 7:20 AM, Pokkai Dokkai wrote: > i don't know how to explain my problem > here i am showing it by an example > > <% > string="Hello Ruby ,How are you" # any String object > width=28 # because width of the below erb tag > is 28 > %> > <%=p "%#{-width}s"%string %> > > the answer is > > =>"Hello Ruby ,How are you " > > > > in above erb tag ("<%=p "%#{-width}s"%string%>") length is 28 > so i assigned width=28 > > here is my question > how to define the width at dynamically for any type of erb tags ? Can you tell what do you want to do? Why do you need to know the length of the tag? Do you want to pad the text with spaces? What's wrong with the following? <% string="Hello Ruby ,How are you" # any String object %> <%= string %>