Good morning,

i am trying to write a js.erb.

 <% if current_user.login == "admin" %>
      var hide = false;
    <% else %>
      var hide = true;
    <% end %>

or


 <% escape_javascript(if current_user.login == "admin") %>
      var hide = false;
    <% escape_javascript(else) %>
      var hide = true;
    <% escape_javascript(end) %>


but every time I got an error in firebug: "invalid XML character".

Can't we just embended ruby in a javascript file?

Thank you
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to