On 9/27/06, Winton <[EMAIL PROTECTED]> wrote:
> > With what error message? I'm not sure why that would be happening.
>
> Here's my dev log:
>
> ActionView::TemplateError (can't convert Hash into String) on line #46
> of app/views/search/index.rhtml:
> 46: body = r.highlight(@condition, :field => :body)
>
> #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb:38:in
> `escape'
>
> #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb:38:in
> `highlight'
> #{RAILS_ROOT}/app/views/search/index.rhtml:46:in
> `_run_rhtml_search_index'
> #{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:66:in
> `method_missing'
If you look at line 66 in acts_as_ferret it seems that r is actually
an instance of ARFerret::SearchResults which is basically an array of
acts_as_ferret model instances with a total_hits attribute. Try this:
body = r[0].highlight(@condition, :field => :body)
That should fix the problem.
Cheers,
Dave
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk