For example, I dont know my website name yet, it can be http://www.abc.com or http://www.xyz.com
And I want to send a email to my users with the link
www.abc.com/controller1/id/path
or
www.xyz.com/controller1/id/path
How I setup this on rails ???
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It doesn’t really matter what the hostname of your app is when using the right helper, rails will generate either relative paths or absolute paths for links at runtime (depending on the helper used). url_for is one such helper, link_to is another. Any route that is defined in routes.rb, you get a helper for it. Try looking at the output from
rake routes, you’ll see which url helpers may already be defined. Just add_pathto the routes you see listed in the first column to get a relative path url. For more info on routing see the Rails Guide.