0
votes
2answers
192 views

Rails: Obtain root_url in environments file

Helper methods in rails automatically detect the root url of the application. For example, user_signup_url automatically uses mydoimain.com/user_signup However, in my environments/production.rb, I ...
6
votes
1answer
694 views

Rails : Send email via Gmail in production

I want to send email via my gmail account in PRODUCTION. It works great in local host. In my environment.rb I have : config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = ...
3
votes
1answer
828 views

in rails set config.action_mailer.default_url_options to whatever the current host of the app is?

How can I dynamically set the host in a config/environments/production.rb: config.action_mailer.default_url_options = { :host => THE_HOST} This is so the app works correctly when in staging and ...
0
votes
3answers
4k views

Rails: how to get the current host, or build a URL with it?

I need to use the host to build a URL with a different port. For example, if the host is example.com, I need to generate a URL like http://example.com:8080/ I need it to be portable, so when I'm in ...
1
vote
1answer
84 views

Setting up a Vanilla Box, how does DNS redirection work?

I'm looking into purchasing a box with EngineYard to host all my clients small websites. The catch with this, is that I'm unsure if its possible to host multiple websites on a vanilla box, and still ...
0
votes
1answer
242 views

different domains pointing to the same rails app

I'm creating a rails app where users will be able to create and manage multiple blogs from their accounts. The app will be hosted on www.mydomain.com but i want users to specify a domain they own and ...
7
votes
3answers
5k views

rspec route testing and hosts

I see I can test routes with rspec like this: get("/").should route_to("welcome#index") but I have constraints based on the hostname or parts of hostnames and redirects between several ones. How do ...
0
votes
4answers
481 views

Rails, test mailer url

My application sends E-mails containing absolute urls. I set host in config/environment/development.rb config.action_mailer.default_url_options = { :host => 'localhost:3000' } Now I want to ...
1
vote
1answer
568 views

dynamic rails host name for routes

I'm doing this in application controller: before_filter :set_app_host def set_app_host Rails.application.routes.default_url_options[:host] = "some url" end This is to have a dynamic host name ...
1
vote
1answer
82 views

How can I configure Rails 3.0.7 host for links for development mode?

Whenever I send out emails in development mode, it does not put the localhost:3000 in the url. Is there any way I can configure this site-wide? I have tried the following: ...
1
vote
2answers
313 views

How can I access named routes in a Rails sweeper?

I have a sweeper that reheats cache by opening urls in forked processes. It's easy enough to hard-code the host for those urls, but I want it to change dynamically, based on environment. I know I can ...
0
votes
0answers
304 views

Access request methods (ActionDispatch::Http::URL) outside controllers

I need this to do smth like that: # in config/application.rb module Appname class Application < Rails::Application config.middleware.use ExceptionNotifier, :email_prefix => "Error on ...
0
votes
1answer
701 views

Virtual host with Passenger

Rails app already works correctly on mydomain.com with Apache+Passenger. In addition, I'm going to deploy non-Rails app(wordpress) on blog.mydomain.com. So I modified httpd.conf like PassengerEnabled ...
1
vote
1answer
321 views

Rails and Exim for Mailer with external mail provider?

we have our mail outsourced. so everything is on an external server. in my rails app i want to send email with exim, but it doesn't work, because the sender address is on another server. Any advice on ...
6
votes
3answers
7k views

Rails: generate a full URL in an ActionMailer view

I'm using ActionMailer to send a sign up confirmation email. The email needs to contain a link back to the site to verify the user, but I can't persuade Rails to generate a full URL (including the ...