Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Mysterious problem #16

Open
ggtesta opened this Issue Aug 24, 2010 · 4 comments

Comments

Projects
None yet
3 participants

ggtesta commented Aug 24, 2010

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?

Owner

jferris commented Aug 24, 2010

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?

ggtesta commented Aug 24, 2010

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.

hgtesta commented Aug 28, 2010

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

Owner

jferris commented Aug 31, 2010

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment