javascript inside rails

Hi ,
I wanted to add rails code into the javascript is there any way to include <%…some code… %> inside … its inside view…

#{ruby code}