2016-07-28 17:44:58 +02:00
|
|
|
class SocialBotController < ActionController::Base
|
|
|
|
def share
|
|
|
|
case request.original_fullpath
|
2017-09-26 15:48:47 +02:00
|
|
|
when /(=%2F|\/)projects(%2F|\/)([\-0-9a-z_]+)/
|
2016-08-01 15:45:56 +02:00
|
|
|
@project = Project.friendly.find("#{$3}")
|
2016-08-01 16:19:50 +02:00
|
|
|
render :project, status: :ok
|
|
|
|
when /(=%2F|\/)events(%2F|\/)([0-9]+)/
|
|
|
|
@event = Event.find("#{$3}".to_i)
|
|
|
|
render :event, status: :ok
|
2018-01-09 15:09:48 +01:00
|
|
|
when /(=%2F|\/)trainings(%2F|\/)([\-0-9a-z_]+)/
|
|
|
|
@training = Training.friendly.find("#{$3}")
|
|
|
|
render :training, status: :ok
|
2016-07-28 17:44:58 +02:00
|
|
|
else
|
|
|
|
puts "unknown bot request : #{request.original_url}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|