using translation variable in link_to

A

Aruna Chinnamuthu

HI ,

In ROR , i m having a line like

<%= link_to("NAME (#{@name})", user_path(@user, :in => :s)) %>

i want to change the string NAME to t:)str_name) ..

how to change it . when i change it , i am getting errors..
 
R

Ryan Davis

HI ,

In ROR , i m having a line like

<%= link_to("NAME (#{@name})", user_path(@user, :in => :s)) %>

i want to change the string NAME to t:)str_name) ..

how to change it . when i change it , i am getting errors..

you should ask on the rubyonrails forum instead.
 
G

Gary Wright

In ROR , i m having a line like
=20
<%=3D link_to("NAME (#{@name})", user_path(@user, :in =3D> :s)) %>
=20
i want to change the string NAME to t:)str_name) ..
=20
how to change it . when i change it , i am getting errors..

Without the actual error message I'm guessing but you probably want =
something like:

<%=3D link_to("#{t:)str_name)} (#{@name})", user_path(@user, :in =3D> =
:s)) %>

And if that fixes your problem then, ruby-talk was an appropriate place =
for the
question since it is just a language issue and not a Rails issue.

Gary Wright=
 
A

Aruna Chinnamuthu

Gary said:
Without the actual error message I'm guessing but you probably want
something like:

<%= link_to("#{t:)str_name)} (#{@name})", user_path(@user, :in => :s))
%>

And if that fixes your problem then, ruby-talk was an appropriate place
for the
question since it is just a language issue and not a Rails issue.

Gary Wright

Thanks Gary .
Its worked for me..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top