try
map.resources :users, :member => {:view_payments => :get}

should work.

On Jan 26, 12:08 pm, Adrian <[email protected]> wrote:
> Hi All
>
> I'm having some issues with the following routes problem.
>
> The routes.rb file ...
>   map.resources :users
>   map.connect '/users/view_payments/:user_id', :controller =>
> 'users', :action => 'view_payments'
>
> The users_controller.rb file ...
>   def view_payments
>     @user = User.find[:params[:user_id]]
>     @payments = @user.payments
>   end
>
> The routes list from a rake routes ...
>      /users/view_payments/:user_id
> {:controller=>"users", :action=>"view_payments"}
>
> The .../views/users/view_payments.html.erb file ...
>    <%= link_to 'View Payments', :controller => 'users', :action =>
> 'view_payments', :user_id => @user.id %>
>
> Then the URL generated from the link_to ...
>    http://localhost:3000/users/view_payments/2
>
> But this returns a 404 error
>
> Any help/ideas appreciated
>
> Cheers
> Adrian
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to