I'm using activeadmin and act as taggable gem. When I insert tags on activeadmin it saves the tags but is not displaying the tags in the view
activeadmin model:
ActiveAdmin.register Project do
index do
column :id
column :name
column :created_at
column :tag_list
default_actions
end
form(:html => { :multipart => true }) do |f|
f.inputs do
f.input :name
f.input :tag_list, :label => "Tags", :hint => 'Comma separated'
f.input :content, :input_html => {:class => "ckeditor"}
f.input :image, :as => :file
end
f.buttons
end
end
model:
class Project < ActiveRecord::Base
attr_accessible :content, :name, :image, :tag_list
mount_uploader :image, ImageUploader
acts_as_taggable
def previous_project
self.class.first(:conditions => ["name < ?", name], :order => "name desc")
end
def next_project
self.class.first(:conditions => ["name > ?", name], :order => "name asc")
end
end
View:
<% @projects.each do |project| %>
<figure class="d1-d3">
<%= image_tag project.image_url(:thumb) if project.image? %>
<figcaption>
<h4><%= link_to project.name, project %></h4>
<% project.tag_list %>
</figcaption>
</figure>
<% end %>
I tried to use <%= project.tags %>
and it didn't work either
Thanks
Try to add this into your Project model (below acts_as_taggable)
And remember to run the migrations, example: