On Mar 3, 2012, at 3:17 PM, Fresh Mix wrote:
> 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 ?
Have you followed these steps:
http://guides.rubyonrails.org/i18n.html#setting-and-passing-the-locale
I think that you're missing the part where you take the params[:locale] and do
something with it.
Walter
>
> --
> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.