def twitter_share_url(opts = {})
      page_url = opts.fetch(:url, request.original_url)
      message = opts.fetch(:message, '')

      page_url = CGI.escape(page_url)
      share_url = "https://twitter.com/intent/tweet/?url=#{page_url}"
      share_url += "&amp;text=#{CGI.escape(message)}" if message.present?

      share_url
    end
def twitter_share_url(opts = {})
      page_url = opts.fetch(:url, request.original_url)
      message = opts.fetch(:message, '')

      page_url = CGI.escape(page_url)
      share_url = "https://twitter.com/intent/tweet/?url=#{page_url}"
      share_url += "&amp;text=#{CGI.escape(message)}" if message.present?

      share_url
    end
Twitter social sharing
 URL snippet built from - https://sharingbuttons.io/

 @param [Hash] opts the options to create the share URL
 @option opts [String] :url Supply URL if would like to share URL other than the current
 @option opts [String] :message The message to provide a message for the tweet.

 @return [String] Twitter URL to share a page