How to get visitor details (IP, Hostname, Browser, Operating System etc)?

Hi, As the title says how can I get all the visitor details like visitor IP, Hostname, Browser, Operating System etc and save them to the database? Thanks.

Posted almost 4 years ago by Sumeet
Posted almost 4 years ago by Sumeet

No its not working. I just need some idea. The code Is correct or not? How can I make a button below links when it clicked it will shorten the url?

1
Posted almost 4 years ago by Alex Yang

Yes, I didn't think the code would work as it's calling itself within the 'if' statement. You should think carefully about what exactly you want the 'shorten' method to do, and what the 'promote' action should do as well. What do you want to happen when the button beneath a URL is clicked? That logic needs to be written into the code within the 'promote' action.

1
Posted almost 4 years ago by Sumeet

Hi it is solved now. I need your help in the following.

http://stackoverflow.com/questions/33844342/url-shortener-in-rails-for-already-created-long-urls

1
Posted almost 4 years ago by Alex Yang

Sorry Sumeet, but this is quite specific and beyond the scope of any of our courses. It's also not clear to me where exactly you need help. Your 'shorten' code looks like it's calling itself - is it working?

1