The link between events and organisations is not based on a "tagified" orga's name.

Space, quote and asterisk are replaced with a dash. Colons are removed.

Close #3
recurrent
echarp 7 years ago
parent 27901e6adf
commit 3387a38bda

@ -37,8 +37,8 @@ class OrgasController < ApplicationController
def show
@search = Orga.search params[:q]
@events_future = Event.moderated.future.tag @orga.name
@events_past = Event.moderated.past.tag @orga.name
@events_future = Event.moderated.future.tag @orga.name_as_tag
@events_past = Event.moderated.past.tag @orga.name_as_tag
end
# PATCH/PUT /orgas/1

@ -45,4 +45,8 @@ class Orga < ActiveRecord::Base
def send_secret
OrgaMailer.create(self).deliver_now!
end
def name_as_tag
name.gsub(/[\s\*']/, '-').delete ':'
end
end

@ -96,5 +96,6 @@
%dt= t '.past'
%dd= t '.count', count: @events_past.count
.events#map{ data: { url: maps_path(format: :json, tag: @orga.name,
future: false) } }
.events#map{ title: @orga.name_as_tag,
data: { url: maps_path(format: :json, tag: @orga.name_as_tag,
future: false) } }

Loading…
Cancel
Save