Sha256: 8a5ce58c3f28e077a3db244305a0e07812117398637917612267e22a6c64bba2

Contents?: true

Size: 569 Bytes

Versions: 2

Compression:

Stored size: 569 Bytes

Contents

module Enjoy::Goto
  module Controllers
    module Transfers
      extend ActiveSupport::Concern

      def index
        url = Addressable::URI.parse(params[:url]) rescue nil
        referer = (request.referer ? Addressable::URI.parse(request.referer) : nil) rescue nil

        @transfer = Transfer.new
        @transfer.recieved_url = params[:url]
        @transfer.url = url.to_s
        @transfer.host = url.host.to_s if url
        @transfer.referer = referer.to_s
        @transfer.save

        redirect_to @transfer.url, code: 303
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
enjoy_cms_goto-0.3.6 lib/enjoy/goto/controllers/transfers.rb
enjoy_cms_goto-0.3.5 lib/enjoy/goto/controllers/transfers.rb