I’m working with a Rails 3 Routes file and the resource mapping looks like this:
resources :projects do
new do
post :add_test_phase
post :add_client
post :refresh_form
end
I’ve read the Routes Guide for Rails 3 but find no mention of this. I know what “member” or “collection” add but am stumped by this new tag. Does it mean perform the mentioned posts when a new project is created?
It works just like the
post doblock does. It’s just for creating a bunch ofnewroutes. Your above example would give youadd_test_phase_new_project_pathmapped toprojects#add_test_phase,add_client_new_project_pathmapped toprojects#add_client,refresh_form_new_project_pathmapped toprojects#refresh_form. The urls would be/projects/new/add_test_phase,/projects/new/add_clientand/projects/new/refresh_form. Although, honestly, I don’t really see a good use case for this.