Marcos Arias
2c39836dc3
Refactored and fixed Resources.map_member_actions to make use of custom ActionController::Base.resources_path_names when the option :path_names is not directly specified. Added a specific test for this functionality and fixed assert_restful_routes_for test helper to make use of ActionController::Base.resources_path_names instead of just "new" or "edit".
...
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#111 state:resolved]
2008-05-06 21:48:07 +12:00
Eugene Pimenov
e6a3ce3392
Make sure member names aren't mistakenly set to nil when providing :path_names
...
[#19 state:resolved]
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-04-23 20:19:22 +12:00
Michael Koziarski
063c393bf0
Allow alternative values for the 'new' and 'edit' actions in resourceful routes.
...
map.resource :schools, :as => 'escuelas', :path_names => { :new => 'nueva' }
Closes #11181 . [ivanvr]
2008-04-12 12:40:40 +12:00
Jeremy Kemper
fadaba679a
Introduce map.resources :cards, :as => 'tarjetas' to use a custom resource name in the URL: cards_path == '/tarjetas'. Closes #10578 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8785 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-02 05:57:16 +00:00
Jeremy Kemper
9d755f1983
require abstract_unit directly since test is in load path
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8564 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 13:32:06 +00:00
Rick Olson
904df818d6
Move ActionController::Routing.optimise_named_routes to ActionController::Base.optimise_named_routes. Now you can set it in the config.
...
ActionController::Routing::DynamicSegment#interpolation_chunk should call #to_s on all values before calling URI.escape. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7724 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-03 05:47:41 +00:00
David Heinemeier Hansson
b611c685d9
Fixed that resource namespaces wouldnt stick to all nested resources ( closes #9399 ) [pixeltrix]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7447 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-10 14:31:44 +00:00
Michael Koziarski
80ff0b9f1c
Optimise named route generation when using positional arguments. Closes #9450 [Koz]
...
This change delivers significant performance benefits for the most
common usage scenarios for modern rails applications by avoiding the
costly trip through url_for. Initial benchmarks indicate this is
between 6 and 20 times as fast.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7421 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-09 00:18:55 +00:00
Tobias Lütke
68d685056a
Remove deprecated named routes [pixeltrix]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7415 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-06 14:28:32 +00:00
Rick Olson
bdcbfa9944
Allow you to set custom :conditions on resource routes. [Rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7234 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-25 02:47:21 +00:00
Jeremy Kemper
557e19346a
Prefix nested resource named routes with their action name, e.g. new_group_user_path(@group) instead of group_new_user_path(@group). The old nested action named route is deprecated in Rails 1.2.4. Closes #8558 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7138 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-27 08:38:55 +00:00
Jeremy Kemper
8ce5479307
Routing: map.resource :logo routes to LogosController so the controller may be reused for multiple nestings or namespaces.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6922 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-01 04:40:30 +00:00
Jeremy Kemper
dcaa074abf
Routing: respond with 405 Method Not Allowed status when the route path matches but the HTTP method does not. Closes #6953 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6862 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 20:07:34 +00:00
Jeremy Kemper
def8f101b8
Strip junk whitespace from [6806].
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6807 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-22 09:38:54 +00:00
Jeremy Kemper
5a3b4cf0bc
Resource namespaces are inherited by their has_many subresources. Closes #8280 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6806 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-22 09:37:07 +00:00
Tobias Lütke
1008535905
Allow routes to be declared off namespaces
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6783 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-19 16:26:44 +00:00
Tobias Lütke
04823ff48f
Allow nested namespaces in routing
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6748 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-17 01:27:54 +00:00
David Heinemeier Hansson
8326a15784
Added map.namespace to deal with the common situation of admin sections and the like [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6594 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-27 16:58:36 +00:00
David Heinemeier Hansson
f985bfd8f8
Added test case for overwritting the name prefix
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6593 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-27 05:10:23 +00:00
David Heinemeier Hansson
8bf1f25254
Name prefix should nest like path prefix
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6592 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-27 05:07:56 +00:00
David Heinemeier Hansson
0adf4a97c1
Actually make the name_prefix work like the previous checkin said it would
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6590 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-27 05:06:38 +00:00
David Heinemeier Hansson
63aea3ffa9
Added :has_many and :has_one for declaring plural and singular resources beneath the current [DHH] Added :name_prefix as standard for nested resources [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6588 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-26 23:11:31 +00:00
David Heinemeier Hansson
0cac2806a6
Dropped the use of ; as a separator of non-crud actions on resources and went back to the vanilla slash. It was a neat idea, but lots of the non-crud actions turned out not to be RPC (as the ; was primarily intended to discourage), but legitimate sub-resources, like /parties/recent, which didn't deserve the uglification of /parties;recent. Further more, the semicolon caused issues with caching and HTTP authentication in Safari. Just Not Worth It [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6485 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-28 21:55:40 +00:00
David Heinemeier Hansson
784298008b
Allow routing requirements on map.resource(s) ( closes #7633 ) [quixoten]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6232 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-25 20:13:19 +00:00
Jeremy Kemper
799f556fe1
Resource member routes require :id, eliminating the ambiguous overlap with collection routes. Closes #7229 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6062 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-28 08:20:04 +00:00
Rick Olson
582c028b14
Heckling ActionController::Resources::Resource revealed that set_prefixes didn't break when :name_prefix was munged. #7081 [Kevin Clark]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5974 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-17 06:46:02 +00:00
Rick Olson
0727af86fc
Fix bug where nested resources ignore a parent singleton parent's path prefix. Closes #6940 [Dan Kubb]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5872 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-08 01:07:48 +00:00
Jeremy Kemper
68d2926ab0
Singleton resources: POST /singleton => create, GET /singleton/new => new
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5772 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-22 03:16:50 +00:00
Rick Olson
90179a9ba5
added tests checking for nested singleton resources
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5703 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-07 16:31:41 +00:00
Rick Olson
d0fa4d3e33
Add singleton resources. [Rick Olson]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5701 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-07 15:36:08 +00:00
Jamis Buck
6a8dcc8a5b
Make sure map.resources(:things, :new => { :new => :any }) correctly sets /things/new to be accessible by any method rather than creating another resource at /things/new;new
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5195 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-26 22:45:09 +00:00
Jeremy Kemper
3d3ba58dbb
remove implicit primary actions - more pain than gain. test collection actions for other http methods. strip whitespace.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5111 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-14 19:53:04 +00:00
David Heinemeier Hansson
73a8d7393f
Make sure that formatted routes for all verbs are created. Still needs to resolve two failing tests after this refactoring [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5096 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-13 04:04:19 +00:00
David Heinemeier Hansson
5130fc84c6
Remove duplicate routes from mapped resources ( closes #5712 ) [eigentone@gmail.com]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4669 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-05 20:46:49 +00:00
Jeremy Kemper
c9417dcef3
Nested resource testing.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4643 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-01 01:23:06 +00:00
Jeremy Kemper
a247d72139
Nesting map.resources
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4642 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-01 00:29:02 +00:00
Rick Olson
78e37f45c6
Fix bug when passing multiple options to SimplyRestful, like :new => { :preview => :get, :draft => :get }. [Rick Olson, Josh Susser, Lars Pind]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4641 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-31 21:57:59 +00:00
Rick Olson
d2eafa8b73
Dup the options passed to map.resources so that multiple resources get the same options. [Rick Olson]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4639 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-31 20:32:48 +00:00
Rick Olson
ed4c295c47
Fixed the new_#{resource}_url route and added named route tests for Simply Restful. [Rick Olson]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4638 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-31 20:00:18 +00:00
David Heinemeier Hansson
865b175765
Added map.resources from the Simply Restful plugin (backwards incompatible with the plugin!) [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4637 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-31 18:59:58 +00:00