I am trying to get the link to go to
admin.mysite.com/articles/new
and currently am using
link_to 'new article', [root_url(subdomain: 'admin), 'articles/new'].join
but am sure there's a better (rails) way to do it. Any ideas?
You can use the URL helper with subdomain as below:
link_to 'new article', new_article_url(subdomain: 'admin')
Assuming new_article_url
will points to articles/new
.