Hello everybody, I would like to use a pretty path like new_article in order to route easily on a specific ressource. In my case, I had added this new action in my articles controller: def lock #... end And now I would like to use a path such as: lock_article. But when I do this: rake routes, I don''t see this path. In my routes.rb file, I just have this: map.resources :articles Thanks for any ideas. ENJOY RAILS!!! -- 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 would like to use a pretty path like new_article in order to route > easily on a specific ressource. > In my case, I had added this new action in my articles controller: >...> In my routes.rb file, I just have this: > map.resources :articles >easy one. you must define all non CRUD actions. actions that work on articles in general (like index, require no article id): map.resources :articles, :collection => [:lock] actions that work on single articles (require article id like show or edit) map.resources :articles, :member => [:lock] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Up please. I don''t know if my answer was well enunciated. Actually I would like to be able to use a path like: new_article_path, edit_article_path, article_path, etc. But I would like so with lock_article_path (in order to focus on lock action). And as it is not RESTful, this do not work... I don''t know what kind of configuration can solve this trouble. -- 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 -~----------~----~----~----~------~----~------~--~---