Routing question

1 view
Skip to first unread message

DanC

unread,
Apr 14, 2009, 9:59:27 AM4/14/09
to Ruby on Rails: Talk
I have a resource for jobs on my application and I am familiar with
RESTful routes etc. I am also happy adding some custom routes to my
controller.

My question is, can I create an alias controller, i.e. instead of
www.mysite.com/jobs can I use www.mysite.com/alias as the 'jobs'
isn't very intuitive for what the app is doing.

Can I do this in routes.rb so I don't have to create any files?

Better still would be to set up a sub-domain type route that worked
like alias.mysite.com = mysite.com/jobs

Again I am unsure on whether this is possible.

Any advice or quality links to good resources would be appreciated

Regards,

Dan

Tim

unread,
Apr 14, 2009, 4:20:12 PM4/14/09
to Ruby on Rails: Talk
map.resources :jobs, :as => :alias

Hope that helps!
Tm

On Apr 14, 6:59 am, DanC <d.m.coleg...@durham.ac.uk> wrote:
> I have a resource for jobs on my application and I am familiar with
> RESTful routes etc. I am also happy adding some custom routes to my
> controller.
>
> My question is, can I create an alias controller, i.e. instead ofwww.mysite.com/jobscan I usewww.mysite.com/alias as the 'jobs'
Reply all
Reply to author
Forward
0 new messages