Multiple scope routes

4 views
Skip to first unread message

Rick Cockerham

unread,
Aug 21, 2013, 10:01:31 AM8/21/13
to rubyonra...@googlegroups.com
Here's an interesting question that I'm not sure has an answer. I would
like a controller to be accessed by multiple URL's within Rails.

example.com/crm/users/1
example.com/admin/users/1

They should both show the same page.

This works, but is an anti-DRY solution:
scope "/crm" do
resources :users
end
scope "/admin" do
resources :users
end

The solution I'm thinking of is to rewrite using Apache. But, first I'd
like to know if I can do this within the routes because I have many
apache configs, but just one route file.

Thanks,
Rick

--
Posted via http://www.ruby-forum.com/.
Reply all
Reply to author
Forward
0 new messages