Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/svenfuchs/inherited_resources_helpers
https://github.com/svenfuchs/inherited_resources_helpers
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/svenfuchs/inherited_resources_helpers
- Owner: svenfuchs
- Created: 2010-09-11T11:48:44.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2011-06-28T11:26:32.000Z (over 13 years ago)
- Last Synced: 2024-10-26T22:39:41.977Z (2 months ago)
- Language: Ruby
- Size: 123 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
Based on InheritedResources
# controller#resource
Always returns the current resource instance which depends on the controller
and the current action:posts#index => Post.new (?)
posts#show => post
posts#new => Post.new (?)
posts#create => Post.new (?)
posts#edit => post
posts#update => post
posts#destroy => post# controller#resources
Returns an array containing the current resource and all of its inherited
resources as defined by the controller through InheritedResources.E.g. on admin/sites/1/blogs/1/posts/1 the resources array equals [:admin, site, blog, post]
# resource url helpers
Defined for each get-able action, basically delegates to polymorphic_path with
the current resources array:index_url, alias: collection_url
new_url
edit_url
show_url, aliased resource_url# resource link helpers
link_to_index, alias: link_to_collection
link_to_new
link_to_edit
link_to_show