views:

30

answers:

1

hello frens i have a problem as following.

i have a resources setup in my routes.rb file as following

resources :users do
    resources :sub_transactions
end
resources :sub_transactions do
    collection do
        get :income
        get :expenditure
    end
end

Now what is the correct route that i should write so that i can generate the following routes

users/1/sub_transactions/income
users/1/sub_transactions/expenditure

where income and expenditure are not ids

+1  A: 

Have you tried adding those calls to the nested sub_transactions resource? Like:

resources :users do
  resources :sub_transactions do
    collection do 
      get :income
      get :expenditure
    end
  end
end

I'm not in a position to test at the moment but that would be the logical starting point (I figure).

Shadwell
thanks i will try this
Gagan