Created
February 18, 2014 07:37
-
-
Save onesup/9066251 to your computer and use it in GitHub Desktop.
gabba 적용
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HomeController < ApplicationController | |
def switch | |
tracking_id = Rails.application.secrets.ga_tracking_id | |
url = Rails.application.secrets.url | |
Gabba::Gabba.new(tracking_id, url).page_view("pc/mobile switch page", "/") | |
user_agent = UserAgent.parse(request.user_agent) | |
if user_agent.mobile? | |
redirect_to mobile_index_path({s: params[:s]}) | |
else | |
redirect_to home_index_path({s: params[:s]}) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment