Detect whether is request coming from phone or tablet or desktop at controller level using ruby on rails
need to detect whether a request to a website is coming from desktop or mobile or tablet and then take 3 different actions accordingly. for example if request is coming from desktop , i take action 1, if request is coming from mobile , i take action 2 and if request comes from tablet then i take action 3.