Rails 3, i18n: Interpolating html tags into text

后端 未结 2 1801
滥情空心
滥情空心 2021-02-07 16:23

My problem is exactly the one described in this question. Only difference: I\'m using Rails 3 (3.0.4 exactly), which uses the %{...} syntax rather than the old

2条回答
  •  情深已故
    2021-02-07 16:40

    You can do like this

    my_translation: "Click to access %{link} page"
    

    then:

    <%= t( my_translation, :link => link_to("Google", "http://google.com") ).html_safe %>
    

    And everything will be ok!

提交回复
热议问题