Closed hquick81 closed 10 years ago
Now after a little bit thinking and trying arround i came up with the following solution:
language_tab do
text { "<img id=\"current_lang\" src=\"/assets/flags/#{I18n.locale}.png\" width=\"16\" height=\"11\" />" }
link_path { "" }
visible_when { true }
enabled_when { true }
active_when { false }
active_when { a_subtab_is_active }
end
de_language_subtab do
text { '<img src="/assets/flags/de.png" width="16" height="11" /> [DE] Deutsch' }
link_path { url_for(:locale => :de) }
visible_when { true }
enabled_when { true }
active_when { false }
end
en_language_subtab do
text { '<img src="/assets/flags/en.png" width="16" height="11" /> [US] English' }
link_path { url_for(:locale => :en) }
visible_when { true }
enabled_when { true }
active_when { false }
end
Thx for this gem !
Glad you figured it out! Also, if you don't want to hard-code the HTML, you can extract the link_to into a view helper and call that view helper inside the text { } declaration.
Hi,
is there any way to link to a locale like i would do normally with
Thx and greetings
Holger