Walter Davis wrote in post #1049973:
> On Mar 3, 2012, at 2:36 PM, Fresh Mix wrote:
>
>>>
>>> Walter
>>
>> <%= link_to('in english', :locale => 'en') if (I18n.locale != 'en') %> ?
>>
>> Doesn't work!
>
>
> Then please define doesn't work.

Ok, this code:

<%= I18n.locale %>
<%= link_to('in english', :locale => 'en') if (I18n.locale != 'en') %>

returns this html:

en
<a href="/welcome/index?locale=en">in english</a>

Why? If I18n.locale == 'en'  there should not be link.

So why "if (I18n.locale != 'en')" is true ?

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

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to