RJS error ("Can't find variable: point") not providing sufficient information

Hi All,

I’m having an issue with rails involving javascript. Basically, I
have the following code:

<ul id="all-points">
<%for point in Point.find(:all)%>
  <%domid = "point[all][#{point.id}]"%>
  <li class="available-point" id='<%=domid%>'>
      <%= link_to_remote "ADD",:url => {:action => "add_point"},
        :html => {:style => "background: wheat; color: gray; text-

decoration: none; border: 1px solid gray;"},
:with => “‘point=’ + #{domid}”

(<%=point.source%>) &nbsp <%=point.name%>

<%= draggable_element(domid, :ghosting => true, :revert =>
true, :scroll => “window”)%>

However, I keep receiving RJS errors telling me “Can’t find variable:
point”. The error has something to do with DOMID as when I change the
word “point” to “alksdjflksdjfls” (a.k.a. garbage), it warns me about
the garbage name. I’m admittedly rusty when it comes to Javascript,
but this error doesn’t seem to give enough info. Can someone please
tell me what is wrong with my code?

FYI, the error comes in my controller when I say:

def add_point
 render :update do |page|
   page.insert_html :bottom, "selected-points", "<li>test phrase</

page.remove params[:point] #error occurs here

I’ve tried encodeURIComponent as well, but nothing seems to matter.
Also, I’m using both Safari and Firefox to debug. Thoughts?


Wow. Nevermind. Was a case of attempting to follow an example too
closely. Literalism FAIL! After adjusting my “:with” to “point = #
{domid}” everything worked.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs