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

15 lines
433 B
Ruby
Raw Normal View History

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"
2014-02-06 21:44:49 +00:00
redirect_to music_session_detail_url(share_token.shareable_id)
else
2014-02-06 21:44:49 +00:00
redirect_to recording_detail_url(share_token.shareable_id)
end
end
end