I have a rails app that will show details for a particular project. I am
hoping to make it easy on users by providing subdomains for each project
and specifying the project ID in the routes file as follows -
map.connect '':controller/:action/:id'',
:defaults => { :action => ''list'', :id
=> nil },
:project_id => 3 # Specify the project ID here.
So once my application gets a request, it has params[:project_id]
defined, that I can use to filter the content made available to users.
This works fine in development and production mode. But functional tests
for controllers don''t like this and barf with - "No route
matches" for
any action.
Any thoughts? comments?
The ugly workaround I have is to add this to routes.rb above the above
route -
if ENV[''RAILS_ENV''] == ''test''
map.connect ":controller/:action/:id"
end
and call every ''get'' in functional controller as
get :action, {:project_id => 3}
This works but is Not DRY and Not fun.
What am I missing here?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---