Hi John, try this approach: in the Product class add this function- require 'uri' def self.find_custom arg object = self.new object.id = URI.escape(arg) object end
and in the controller try calling as: Product.find_custom(params[:id]).view_all just try it, and let me know. On Fri, Aug 28, 2009 at 9:04 PM, John Mcleod < rails-mailing-l...@andreas-s.net> wrote: > > Hello all, > Here's a newbie question (4 weeks and counting). > My routes.rb is as below. > > map.resources :projects, :departments, :users, :admins, :imports, :notes > > #Below is route in question > map.resources :projects, :collection => { :view_all => :get } > > map.home '', :controller => 'projects', :action => 'index' > map.connect ':controller/:action/:id.:format' > map.connect ':controller/:action/:id' > > I'm tried to get a url like this: > http://localhost:3000/projects/view_all > > I have a view_all in the ProjectsController and I have a view_all > template. > > When I type in the desired url, I get this error: > > "ActiveRecord::RecordNotFound in ProjectsController#show > > Couldn't find Project with ID=view_all" > > Thank you for any help. > > JohnM > -- > Posted via http://www.ruby-forum.com/. > > > > -- Regards, Himanshu --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---