2

I have my main application that contains my pages controller. It's just a quick way for me to keep all my static pages in one spot.

I have a sub app that is going to be using the same layout (copy and paste for now). The layout is using a url_for(:pages, :about) to access /about

However that doesn't work in the sub app because the pages controller doesn't exist.

How can I use the url_for so I don't have the hardcode the paths in case I change the mapping later on?

is there a way to say

url_for(:project, :controller, :action)

does the sub have a parent property that exposes the top level project?

Mike
  • 33
  • 3

1 Answers1

5

You can call it directly with:

OtherApp.url(:controller, :action)
DAddYE
  • 1,719
  • 11
  • 16