Hi All,
In my config/user.yml
age: |
the age of the user is <%=user.age%>
the name of the user is<%=user.name%>
In my controller:
user=User.find_by_name("judi")
age=user.age => i get 34
puts eval(USER["age"]) =>get nil value in console
puts (USER["age"] => got "the age of the user is
<%=user.age%>
the name of the user
is<%=user.name%>"
In view:
<%=eval(USER["age"])%>
i didnt get anything in view..
can anybody help me to replace the <%=user.age%>,<%=user.name%>
dynamically in yml file
thanks
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
> In my config/user.yml > > age: | > the age of the user is <%=user.age%> > the name of the user is<%=user.name%> > > > In my controller: > user=User.find_by_name("judi") > age=user.age => i get 34 > puts eval(USER["age"]) =>get nil value in console > puts (USER["age"] => got "the age of the user is <%=user.age%> > the name of the user is<%=user.name%>" > > > > In view: > > <%=eval(USER["age"])%> > > i didnt get anything in view.. > > can anybody help me to replace the <%=user.age%>,<%=user.name%> dynamically in yml filehttp://guides.rubyonrails.org/i18n.html#internationalizing-your-application http://guides.rubyonrails.org/i18n.html#interpolation -philip -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.