Hello,

Say I have the following in my routes file:

scope "(/:organization)" do
resources :systems, :except => [:destroy] do
member do
get :packages
end
end
end

resources :dashboard do
collection do
get :notices
end

The organization can be changed by the user and various resources such
as systems are scoped off of the organization. So, the organization
can change dynamically and so as to be restful we want to prepend the
organization to each route within that scope. Following the Rails
guides, I attempted to use:

default_url_options()
{ :organization => current_organization.name }
end

Which generated URLs in the way desired, e.g. /Organization1/system/
However, the URLs generated (via _path() calls, e.g. dashboard_path())
include the extra paramter ?organization=Organization1 which is not
the behavior desired for this application.

My question then is - is it possible to have the organization set and
included for only those routes that declare a scope of /:organization.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 5, '11 at 9:25p
activeOct 5, '11 at 9:25p
posts1
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Eric Helms: 1 post

People

Translate

site design / logo © 2022 Grokbase