Base URL of Rails app in Model
问题 In order to be able to see if a User has shared my page on Facebook, I want to be able to create this kind of URLs: http://graph.facebook.com/?id=http://stylehatch.co/some_unique_user_token Where http://stylehatch.co would need to be my base URL. I am thinking on having a method in the User model that will build and return that URL, but I can't access root_url from within my model. How can I get the base URL of my application from a Model? Say if my urls look like this: http://myapp.com/users