Skip to content
Newer
Older
100644 131 lines (90 sloc) 5.25 KB
2200ba9 * Major internal changes, and some API change: see the rdoc for details.
ian authored Sep 5, 2007
1 * Major internal changes, and some API change: see the rdoc for details.
2 The headlines:
3 - load_enclosing is now true by default
4 - BC: the old options work for now, but you'll get deprecation messages
5 - refactored a lot of code into friend classes - in particular there is now
6 ResourcesController::Specification which specifies how to find a resource from the route
7
1dc4d3f resources_controller:
ian authored Aug 23, 2007
8 * Fixed some problems with internals of RC when :load_enclosing => true
9
68ddf96 * resources_controller now supports singleton resources! and much bet…
ian authored Aug 18, 2007
10 * resources_controller now supports singleton resources! and much better :load_enclosing support
11 Booya! =>
12 class TagsController < ApplicationController
13 resources_controller_for :tags, :load_enclosing => true
14 end
15
16 this will service all these routes (loading the resources into assigns for the view)
17
18 /tags
19 /forums/2/tags
20 /images/1/tags
21 /home/tags <= singular resource
22 /users/1/image/tags <= nested singular resource
23
24 Also
25
26 class BlogController < ApplicationController
27 resources_controller_for :blog, :singleton => true, :load_enclosing => true
28 end
29
30 class PostController < ApplicationController
31 resources_controller_for :post, :load_enclosing => true
32 end
33
34 for /campaigns/1/blog
35 /users/2/blog
36 /campaigns/1/blog/posts
37 /users/2/blog/posts
38
39 etc...
40
41 TODO: rewrite docs - for now check out the spec suite.
42 TODO: refactor code - I did it BDD stylee, so there's lots of specs but also a lot of code that 'is the simplest thing that makes the specs pass'
43
48c58cd resources_controller:
ian authored Aug 18, 2007
44 * resources_request has changed format - it now returns an array like this
45 [ {:name => "forums", :name_prefix => "forum_", :key => :forum_id, :id => "1"}, {:name => "posts"}]
46 Singular resources are detected properly (see spec/specs/resources_controller_spec for some tests).
47 This paves the way for singular_resource support, and better 'many routes/one controller' support
48
49 Decided that Patching Routing was a bad idea, so route is re-recognized using the request path. This
50 only happens for controllers with :load_enclosing => true
51
18e3939 resources_controller:
ian authored Aug 17, 2007
52 * You can now call methods such as enclosing_resource_path, enclosing_resources_path, etc
53 in your controller and view and the correct url helper will be called. These url_helpers are defined
54 as they are needed, so it's pretty fast.
55
56 * Removing routing decoration for now
57
f4f78c8 resources_controller
ian authored Aug 17, 2007
58 * Enclosing resources are now all loaded by one method :load_enclosing which is a prepend_before_filter.
59 This means that you can access the enclosing resources in all before_filters, even when a subclass adds
60 more nestings.
61
62 Example:
63
64 class PostsController < ApplicationController
65 resources_controller_for :posts
66 end
67
68 class UserPostsController < PostsController
69 nested_in :user
70
71 before_filter {|c| raise 'boom' if @user.name == 'Santa'}
72 end
73
f3d7fc4 resources_controller:
ian authored Aug 17, 2007
74 * Removed ResourceService proxy class. This was mainly used for BC with rails <= 1.2.2. If you're
75 using this, then freeze to r377 of resources_controller. The resource_service is now either an
76 ActiveRecord or association proxy.
77
78 * Added route decoration to access the recognized route in the controller (for future parsing of
79 singular resources, and better polymorphic support)
80
bee172f resources_controller: Removed Ardes::ResourcesController::Spec::ViewH…
ian authored Aug 17, 2007
81 * Removed Ardes::ResourcesController::Spec::ViewHelper as it's best to not have a dependency
82 like this in your specs. Just stub out the resource methods that are needed by that view,
83 or use the default assigns.
84
0c5fcae Named path support is much improved. All named routes for the current…
ian authored Jul 30, 2007
85 * Named path support is much improved. All named routes for the current resource can be
86 called by substituting 'resource'. E.g. the following methods in your controller or
87 view will work: :formatted_resource_path, :preview_resource_path (if :preview is in :member),
88 :resource_tags_path, etc, etc.
89 This helps with decoupling the model name from the controller and view.
90
8cf4bad resources_controller: Added flash tests [frederikfix at eml dot cc]
ian authored Jul 23, 2007
91 * Added flash tests [frederikfix at eml dot cc]
92
1535036 resources_controller: Added rjs actions [frederikfix at eml dot cc]
ian authored Jul 23, 2007
93 * Added rjs actions [frederikfix at eml dot cc]
94
1f3e3f4 Added Ardes::ResourcesController::Spec::ViewHelper for easy view testing
ian authored Jul 10, 2007
95 * Added Ardes::ResourcesController::Spec::ViewHelper for easy view testing
96
100ae48 Added Helper#form_for_resource for easy form generation, see rdoc for…
ian authored Jul 10, 2007
97 * Added Helper#form_for_resource for easy form generation, see rdoc for details
98
b7750a5 * Enclosed named paths use the new edge rails conventions for named r…
ian authored Jul 10, 2007
99 * Enclosed named paths use the new edge rails conventions for named routes.
100
101 So to get the path to edit a child tag resource (where resource is 'forum:1')
102 edit_resource_tag_path(@tag) # => '/forums/1/tags/2/edit'
103
104 * Handles options passed to named routes
105
106 resource_path(:sort_by => 'article') # => '/forums/2?sort_by=article'
107
0181a4a Now handles enclosing named paths. You can reference named routes tha…
ian authored Jun 7, 2007
108 * Now handles enclosing named paths. You can reference named routes that are
109 'below' (or enclosed by) the current resource by appending resource_ to that
110 named route. [thanks Chris Hapgood for the initial idea]
111
4e33aa8 resources_controller: (find|new)_resource(s) methods are now defined …
ian authored Jun 7, 2007
112 * (find|new)_resource(s) methods are now defined by resources_controller_for only
113 if they do not already exist
114
84470fa resources_controller: Better regexp for resources_request [Chris Hapg…
ian authored May 30, 2007
115 * Better regexp for resources_request [Chris Hapgood]
116
f042826 resources_controller: Added more specs to get coverage to 100%
ian authored May 10, 2007
117 * Added more specs to get coverage to 100%
118
6dccf6a Upgraded specs for latest edge and rpsec 0.9, improved Rakefile and s…
ian authored May 10, 2007
119 * Upgraded to rpsec 0.9, improved Rakefile and specs so that spec:plugins will work
120
4d8e78d Removed ApplicationController from spec/app.rb to avoid conflicts wit…
ian authored Feb 28, 2007
121 * Removed ApplicationController from spec/app.rb to avoid conflicts with en-
122 closing rails application
123
20d4f25 Added method_missing proxy to ResourceService, to enable the resource…
ian authored Feb 22, 2007
124 * Added method_missing proxy to ResourceService, to enable the resource_service
125 to be used for things other than find or new (for example Pagination) [Dan Kubb]
126
063f481 git-svn-id: https://svn.ardes.com/rails_plugins/resources_controller@200
ian authored Feb 22, 2007
127 * Fixed small error in flash message of destroy action [Dan Kubb]
128
7a47cc1 Removing experimental cruft
ian authored Feb 22, 2007
129 * Removing experimental cruft
130
131 * CHANGELOG started
Something went wrong with that request. Please try again.