A calendar management project, for events and activities related to communities fighting for freedoms.
This can be related to software, art, data, hardware, content, commons, internet.
https://www.agendadulibre.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
agenda-libre-ruby/app/controllers/tags_controller.rb

22 lines
477 B

# Manage event tags
class TagsController < InheritedResources::Base
def index
@tags = Event
.pluck(:tags).map { |e| e.split }.flatten
.group_by { |i| i }
.map { |k, v| [k, v.size] }
.reject { |_k, v| v < 2 }
.sort
respond_to do |format|
format.html
format.json { render json: @tags.to_json }
end
end
def show
@events_future = Event.future.tag params[:id]
@events_past = Event.past.tag params[:id]
end
end