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
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]
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.