Need help with calling a ruby method inside rhtml


#1

My problem is simple. I have a function “translateTo(lang)” that i
need to call in my show_data.rhtml file. The function that i need to
call returns a string that i need to print out on my show_data.rhtml
page.

Should i define the function in the show_data_controller.rb? or some
were else?

What commands should i have in the show_data.rhtml?

show_data.rhtml file



<%= translateTo(@trans)%> <%# What shall i do to make this line work
%>


#2

Hi, you should define the in the application_helper.rb if it is to be
used by all views or show_data_helper if it is only to be used with
views of show_data.

Good luck,

-Conrad


#3

Hi, you should define the in the application_helper.rb if it is to be
used by all views or show_data_helper if it is only to be used with
views of show_data.

Good luck,

-Conrad