Hi James
Thanks for the quick reply, I actually just got it. :D indeed that works.
Maybe you could help me though on how to make a form with multiple
checkboxes, have them return a array of tag ids, and then have my search act
on it.
here is what I have so far not working... (quite new to rails)
index.html.erb
<% for tag in Tag.find(:all, :order => "name asc") %>
<%= check_box_tag 'tag_ids[]', tag.id, false %> #should be
checked according to sent params.
<%=h tag.name %>
<% end %>
books.rb
# attributes
has author.taggings.tag(:id), :as => :tag_ids
search_controller.rb
@books = Book.search params[:q], :conditions => { :tag_ids =>
params[:tag_ids] }
-- Peter Tellgren
On Wed, Apr 15, 2009 at 12:09 PM, James Healy <[email protected]> wrote:
>
> Hi Peter,
>
> peter_tellgren wrote:
> > I just started to build a advance search for a site and I am
> > I tried using the attribute
> > has author.taggings.tag.id, as => tag_id
> > But this won't work as id is a reserved word.
>
> try "has author.taggings.tag(:id), :as => :tag_id"
>
> -- James Healy <jimmy-at-deefa-dot-com> Wed, 15 Apr 2009 20:05:23 +1000
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---