effigy icon indicating copy to clipboard operation
effigy copied to clipboard

Mysterious problem

Open ggtesta opened this issue 15 years ago • 4 comments
trafficstars

I'm with a little issue here. Every time I try to access an HTML tag identified with class or id in my template, Effigy returns me a 'No element matched the given selector' error.

For example, I have a simple template with <div class="page">, and in my view I look for it with find('div.page').replace_each(@pages)..., and I always get this error.

I don't know what I'm doing wrong. I've already tested on others computers and other examples, and the problem persists.

Any suggestions?

ggtesta avatar Aug 24 '10 13:08 ggtesta

I'm sorry to hear you're having trouble. Can you please paste a fuller example, including the full template and view? Also, are you trying this with Rails, or on your own? Can you include more info about your setup?

jferris avatar Aug 24 '10 13:08 jferris

I'm using Effigy 0.4.0 with Ruby 1.8.7 (patchlevel 174), in a Rails app (version 2.3.8). My template is just this:

class MagicIndexView < Effigy::Rails::View
  def transform
    text('h1', @spell)
    text('p.body', "New text");
  end
end

and my view is:

<h1>Spell name</h1>
<p class="body"> Text to substitute </p>

The spell name replacement is ok, but on the second line, the error comes. The complete app you can found here.

But I noticed that this is not a problem with Rails, because the same thing happened in a Ruby test (the README example, here at line 40). I found no records of similar errors like this, but I tested on three different computers, on Ubuntu and in a Mac. Maybe some incompatibility anyway?

Thanks for helping.

ggtesta avatar Aug 24 '10 20:08 ggtesta

This happened to me too, but jferris@1709452345e86ffdb89c fixed the problem. Any chances to get an updated gem 0.4.1 with the modifications in master?

hgtesta avatar Aug 28 '10 15:08 hgtesta

Hey guys - I'll try to release a new version with these fixes soon with these changes. This changes the API, so I want to make sure the old API still works with a deprecation and release 0.5.

jferris avatar Aug 31 '10 13:08 jferris