From: Jano Svitok Date: 2008-06-06T23:32:51+09:00 Subject: Re: erb question --urgent help needed? On Fri, Jun 6, 2008 at 10:55 AM, Pokkai Dokkai wrote: > actually there is a empty paper > > in that paper some datas want to print for some corresponding position > (see below..like name,phone. etc...) > > #empty paper > ------------------------------------------------------------- > | | > | name: phone: | > | | > | post: comment: | > | | > | address: | > ------------------------------------------------------------- > > #paper after print > ------------------------------------------------------------- > | | > | name:mokkai phone: 919234244 | > | | > | post:somthing comment: nothing | > | | > | address:full address detail here...... | > ------------------------------------------------------------- > > so i want to create print details in .rhtml format I can't help you with a general solution, I guess the way you startes is the way to go. Though: 1. you don't need p there - instead of <%=p just leave there <%= 2. create a helper function to pad the string to desired width def pad(lenght, data) data.to_s.just(length) end then you can do: <%= pad 28, name %><%= pad 15, phone_number %> etc. I quite can't imagine what you mean by "define the width at dynamically for any type of erb tags". Don't worry though, the problem is most probably somewhere between my keyboard and my chair ;-) J.