jferris/effigy

Mysterious problem

ggtesta opened this issue · 4 comments

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?

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?

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.

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

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.