It seems that the name of the method used by ActsAsFerret has been
changed to find_with_ferret after the book was published. Can you
replace all instances of find_by_contents with find_with_ferret and
see if that works for you?
Cheers,
//jarkko
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "Beginning Ruby on Rails E-Commerce" group.
> To post to this group, send email to railsec...@googlegroups.com
> To unsubscribe from this group, send email to railsecommerc...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/railsecommerce?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
--
Jarkko Laine
http://jlaine.net
http://dotherightthing.com
http://www.railsecommerce.com
http://odesign.fi
>
> thanks very much Jarkko
>
> that has worked perfectly, thanks very much.
>
> out of interest is there any way of finding out about these kind of
> changes??? as i tried googling for quite some time and couldnt find
> anything.
I'm updating the errata page (http://railsecommerce.com/errata) as I'm
finding out about these changes.
//jarkko
>
> hmmm correction the search function is now sort of wrorking, however
> its not finding any of the test books i have entered into the
> database.
Does it find books you enter now? I don't know if it automatically
indexes books that already exist in the database (but I might be
wrong). Try if running Book.rebuild_index in the console helps.
//jarkko
//jarkko
>
> thats good jarkko
>
> but I was meaning more in terms of what sources do you use to for
> instance find out that find_by_contents has since been changed to
> find_with_ferret?
If something that's a part of a plugin (in this case acts_as_ferret)
doesn't work, there's ultimately three options:
1) you haven't installed the plugin
2) you are not using the plugin (calling acts_as_ferret in the Book
model in this case) correctly.
3) The plugin api has changed.
Since you said you followed the book by the letter, I checked the
plugin's website (http://projects.jkraemer.net/acts_as_ferret/) and
found out (in the introductory tutorial) that they didn't use a method
called find_by_contents anymore. The same can be found in the plugin's
API docs: http://projects.jkraemer.net/rdoc/acts_as_ferret/
In general, Google is your friend.
//jarkko
>
> Hi Jarkko
>
> for some reason find_with_ferret doesnt seem to be working properly,
>
> I have tried performing a couple of test searches for some sample
> books i have entered but it is not finding anything even when i copy
> the book title and paste it into the search box, any ideas why this
> might be??
Sorry, no idea if you already rebuilt the index. You might to ask for
help in the acts_as_ferret forums.
//jarkko