# Is it just me or all all engines links set up as only\_path =\> false?

**URL:** <https://www.ruby-forum.com/t/is-it-just-me-or-all-all-engines-links-set-up-as-only-path-false/149709>\
**Category:** Engines\
**Created:** [September 28, 2008, 8:13pm UTC](https://www.ruby-forum.com/t/is-it-just-me-or-all-all-engines-links-set-up-as-only-path-false/149709 "2008-09-28T20:13:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yossarian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/9de0a6/32.png) [@yossarian](https://www.ruby-forum.com/u/yossarian)\
**Post date:** [September 28, 2008, 8:13pm UTC](https://www.ruby-forum.com/t/is-it-just-me-or-all-all-engines-links-set-up-as-only-path-false/149709/1 "2008-09-28T20:13:47Z")

</div>

Hi there,

Is it the case that all links in engines seem to ignore the default  
Rails only\_path =\> false option? Every link\_to in my Engine results in  
links like:

[Back to articles](http://localhost:3005/admin/articles)

whereas the non-engine views in the same application result in links  
like:

[Back to articles](https://www.ruby-forum.com/admin/articles)

This is a big problem for me because I’m using Rails full-page caching  
on a site which can be accessed via either http or https, and the cache  
files are getting written to disk with the full https:// which is real  
ugly for what I’m trying to do.

Explicitly setting  
ActionController::UrlWriter.default\_url\_options[:only\_path] = true  
doesn’t seem to help anything, and I can’t see anything in the Engines  
plugin that’s explicitly causing this.

Is this behaviour intentional, am I doing something really wrong, or is  
there a configuration option I can set somewhere?

Greets,  
Yossarian

---

<div class="post-metadata">

**Author:** ![yossarian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/9de0a6/32.png) [@yossarian](https://www.ruby-forum.com/u/yossarian)\
**Post date:** [September 28, 2008, 9:14pm UTC](https://www.ruby-forum.com/t/is-it-just-me-or-all-all-engines-links-set-up-as-only-path-false/149709/2 "2008-09-28T21:14:11Z")

</div>

yossarian wrote:

> Is this behaviour intentional, am I doing something really wrong, or is  
> there a configuration option I can set somewhere?

The answer: choice (b), I was doing something really wrong. I  
investigated things further, and I came to the conclusion that whatever  
was causing my problem had to do with actioncontroller routing - I  
noticed that routes in my engine were all absolute when I used the named  
routes from my resources in the engines routes.rb, but not when I  
generated named routes myself using something like:

map.foo ‘foo/bar’, :controller =\> ‘admin/articles’

So I looked a little harder into the Engines routing.rb file, which led  
me to actually read the source code of  
ActionController::Routing::RouteSet for the first time. I never really  
understood before why there was an articles\_url(article) and  
articles\_path(article) but now I realize that the \_url is for a url and  
the \_path is for a path. Now I will go hang my head in shame :).

By the way, Engines are pretty great, and have really helped me do the  
stuff I want to accomplish, so thanks for the plugin!

Yossarian
