Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
Using value from I18N for id
3 Posts
Using value from I18N for id

Hi,

I'd like to use the value of the current i18n to create an id for a header-tag. I'm trying to do this, but I'm not getting a value in my id.(see pastie)

If I hardcode this, it is working, (see pastie)

http://pastie.org/465383

What am I doing wrong?

what does 'content' do?

did you try <h3 id="<%= "short_#{I18n.locale}"%>"> ?

Hey Wouter,

Actually, the problem is with the data representation here,

AS

here the interpreter actually counting "" as two different strings and code inbetween is the simple html data thats why it showing some errors.

The better way to write the code is first use single quote and then double like

It will work.....

3 Posts
Login to add your message