Okay, so in my users controller I have defined a modify function. And then in my views I have placed my modify view. Then in my routes I have added: map.resources :users, :collection => {:login => :get, :logout => :get, :modify => :get } But this doesn''t work: <%= link_to ''Update Information'', modify_user_path %> And I have no idea why modify_user_path doesn''t work. It also doesn''t work for the login and logout that I had to define in my routes.rb. So, 1)why doesn''t the restful-ness work? and 2) Why do i have to modify my routes.rb anyway? Shouldn''t things by automatic when I create a new function? It always assumes that something like /users/newfunction is supposed to be routed to /users/show and [:id] newfunction. By the way, I''m using Rails 1.2.6. Thanks for any help!! -Ryan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Because you''re defining it on a COLLECTION of that resource rather than a MEMBER of that resource :) it should be: map.resources :users, :collection => { :login => :get, :logout => :get }, :member => { :modify => :get } Perhaps look at using restful_authentication. -- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Still can''t rest. You see, I don''t plan to go to /users/1/modify I need to get to /users/modify So wouldn''t that make it part of collection? I''ve already tried it both ways anyway, and "modify_user_path" still doesn''t work. I think I even tried "modify_users_path"... but there''s another question, which one should I be using in which circumstance? I''m guessing you use "_users_path" for collection (ie do something to many users) versus "_user_path" for member (ie do something to just one user?) The specific user_id to modify is already saved in the session. The modify just checks that the user_id is there and then calls the modify view to modify that user id. (I''m using modify instead of just plain ol ''edit'' because edit is going to edit different object attributes. On Jan 13, 10:37 pm, "Ryan Bigg" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Because you''re defining it on a COLLECTION of that resource rather than a > MEMBER of that resource :) > > it should be: map.resources :users, :collection => { :login => :get, :logout > => :get }, :member => { :modify => :get } > > Perhaps look at using restful_authentication. > > -- > Ryan Bigghttp://www.frozenplague.net > Feel free to add me to MSN and/or GTalk as this email.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
kopf1988 wrote:> Still can''t rest. You see, I don''t plan to go to > > /users/1/modify > > I need to get to > > /users/modifyPerhaps you should revisit the overall design of your application. What are you "modifying" about your collection of users? Without knowing anything about your problem domain I would suggest something like /group/edit to remain within the Rails conventions. Just a thought... -- 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 -~----------~----~----~----~------~----~------~--~---
I am only modifying one user, but I don''t want to have to use that type of url - I want to go to /users/modify. That''s because modify is a protected page and if they are not logged in they are sent back to the login page, otherwise they are allowed to modify themself. Like an "update your personal information here" page. On Jan 14, 4:57 am, Daniel Waite <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> kopf1988 wrote: > > Still can''t rest. You see, I don''t plan to go to > > > /users/1/modify > > > I need to get to > > > /users/modify > > Perhaps you should revisit the overall design of your application. > > What are you "modifying" about your collection of users? > > Without knowing anything about your problem domain I would suggest > something like /group/edit to remain within the Rails conventions. > > Just a thought... > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---