I am working on the concept of Localization in Rails and should get some localization values in HTML pages. So, I created an array in the controller, for example, below.
#array use to store all localization values @alertMessages = [] #array values... {:index=>"wakeUp", :value=>"Wake Up"} {:index=>"tokenExpired", :value=>"Token Expired"} {:index=>"timeZone", :value=>"Time Zone"} {:index=>"updating", :value=>"Updating"} {:index=>"loadMore", :value=>"Load More"} #....more
In HTML pages I want to get localization values, like below or some other type,
<%= @alertMessages['wakeUp'] %>
therefore, it displays the value " Awakening ",
But it doesn’t work .. Maybe anyone ...
source share