jam-cloud/web/app/controllers/share_tokens_controller.rb

15 lines
433 B
Ruby

class ShareTokensController < ApplicationController
respond_to :html
def shareable_resolver
share_token = ShareToken.find_by_token!(params[:id])
# TODO: clean this up later to truly use polymorphic associations
if share_token.shareable_type == "session"
redirect_to music_session_detail_url(share_token.shareable_id)
else
redirect_to recording_detail_url(share_token.shareable_id)
end
end
end