On 21 Feb 2008, at 17:06, Bala Krishnan wrote:
>
> Hi,
> I am calling on action using render_component,in that action i am
> again calling one javacritp function.when i am execute this code the
> script is not working,my code is here.
>
>
You don''t seem to be setting @rating in your action. Have you tried
using firebug to step through your javascript and see where it is
failing ?
(oh and render_component is deprecated and very rarely the right thing
to do)
Fred> my view goes here:
> rating :
> <
> %=
> render_component
> (:controller
>
=>''products'',:action=>''star_display'',:params=>{:product_id=>2})%>
>
> action is
> def star_display
> product_id=params[:product_id]
> overall_rating=ProductRating.find
> rating=overall_Rating
> end
>
> My star_display view is
> <img src="/images/star1.gif" id="star1">
> <img src="/images/star1.gif" id="star2">
> <img src="/images/star1.gif" id="star3">
> <img src="/images/star1.gif" id="star4">
> <script language="javascript"
type="text/javascript">
> showAllStars(<%=@rating%>);
> </script>
> here the script is not working.but if i print anything inside of the
> script tag it gets printed means the action executed successfully but
> the script is not running.i don''t know what''s the reason
please
> anybody
> help me.
>
> thanks,
> Bala
> --
> Posted via http://www.ruby-forum.com/.
>
> >
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---