Alex Rivera | Logout

How to use rails-i18n with HAML

Asked 2012-06-08T11:52:39.317
8

I went through http://guides.rubyonrails.org/i18n.html and set up my en.yml file:

en:
  test:
    welcome: Welcome!!!
  registration:
    signup: Sign up for an invite!!

However, in my new.html.haml file, How do I reference signup?

The tutorial only shows how to do so using ERB, not HAML. I tried this and it didn't work:

%h2 <%=t :registration.signup %>

Any ideas?

Edit
Report

1 Answer

0

It worked once I did this:

change en.yml

  registration:
    signup: "Sign up for an invite to join CorkLabs!!!"

in .haml file

%h2= t 'registration.signup'
answered 2012-06-08T12:18:23.817

Your Answer