Answer the question
In order to leave comments, you need to log in
How to make a tag search filter in Ruby on Rails through the acts_as_taggable_on gem using a checkbox?
Good afternoon, I went through a couple of tutorials and decided to do something of my own, but got stuck on this problem:
The bottom line is to display all the tags in the form of a checkbox on the Search page, and when you click on several tags, a list of all posts containing these tags is displayed.
Everything is standard, so I don’t know what to throw off from the code, and whether it is necessary.
Tags in the URL are separated by commas.
Used ROR 3.2.13
Model
class Post < ActiveRecord::Base
attr_accessible :tag_list
acts_as_taggable
end
Answer the question
In order to leave comments, you need to log in
Either I do not see the essence, or you did not understand the question.
The display of tags in posts is there and all the rules.
I need a filter for all tags in checkboxes, well, something like this, I roughly understand, but I don’t understand how to implement it functionally
<%= form_for(@post) do |f| %>
<%= f.label :tag_list %>
<%= f.check_box :tag_list %> #тут скорее всего нужен хеш всех тегов
<%= f.submit %>
<% end %>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question