Seeing as the documentation for this gem is absolutely useless for beginners like myself (they the docs it doesn't say which code needs to go in which file), I figured I might get some better help here for my Rails 4 app instead of the official docs.
I'm not sure if acts-as-taggable-on is the best solution for my problem, but here's what I'm trying to do: I'm creating a business directory that works with tags instead of categories so that a bar/lounge can belong to both a bar, and a lounge. Perhaps someone knows a better solution instead of using acts-as-taggable-on?
There are no errors when I try to create or view the tags, but the problem is that the tags arent' being saved. When I try to view the business which has tags, it shows up empty. Same thing when I try to edit it.
This is what my model looks like:
class Business < ActiveRecord::Base
validates :name, uniqueness: true
acts_as_taggable
acts_as_taggable_on :tag_list
end
The form:
<%= form_for(@business) do |f| %>
...
<div class="field">
<%= f.label :tag_list, "Tags (seperated by commas)" %><br>
<%= f.text_field :tag_list %>
</div>
...
<% end %>
The view:
<p>
<strong>Tags:</strong>
<%= @business.tag_list %>
</p>
Anyone know what is preventing the tags from being viewed/saved? Perhaps there's better documentation out there that someone could provide.
update: I'm also using Active_Admin, which seems to be causing some problem according to Matt Boldt. After following his tutorial my problem remains unsolved.