0

In my I18n file i have the following translation:

reservation:
  please_accept: "Please accept regulation"

And in my view i'm using it in the following way:

= t('reservation.please_accept')

Now I want to the word "regulation" be a link to some action in my app. How can I do that? Thanks in advance.

Mateusz Urbański
  • 7,352
  • 15
  • 68
  • 133
  • 1
    You mean something like this `<%= link_to(t("Regulation"), your_path)) %>` – Pavan Jun 26 '14 at 11:43
  • 1
    possible duplicate of [rails i18n - translating text with links inside](http://stackoverflow.com/questions/2543936/rails-i18n-translating-text-with-links-inside) – Pavan Jun 26 '14 at 11:58

1 Answers1

0

Answer for my question:

= t('reservation.please_accept', href: link_to(t('reservation.regulation_word'), '#', "data-toggle" => "modal", 'data-target' => "##{@car.id}")).html_safe

reservation:
    regulation_word: "regulamin"
    please_accept: "Proszę zaakceptować %{href} wypożyczalni"
Mateusz Urbański
  • 7,352
  • 15
  • 68
  • 133