Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 301 lines (205 sloc) 11.827 kb
4b31d14 @ianwhite Updated CHENGELOG
authored
1 * The reason for the reversion in c21f35c has been fixed. Thanks Jason Lee for the bug report.
2
3 The problem was that I had changed resource_saved?'s behaviour to *not* saving the model if it had
4 already been saved. In the future resource_saved? will be deprecated, but not yet.
5
6 BTW. All of these changes to resource_saved? behaviour is aimed at making RC drop in compatible with
7 rspec's generated controller specs (try rake spec:generate).
8
9 To do that I need the default update action to use :update_attributes. This meant that the old strategy
10 of keeping track of saves by using save_resource wont work. Instead, we keep track by looking at the
11 AR's state (see lib/ardes/active_record/saved.rb) which is a far better solution anyway.
12
ceaf1b9 @ianwhite The reason for the reversion in c21f35c has been fixed. Thanks Jason…
authored
13 * API change: save_resource deprecated
14
15 So save_resource is now deprecated, just use resource.save
16 ActiveRecords can now be asked if they are saved?
4b31d14 @ianwhite Updated CHENGELOG
authored
17
633fe45 @ianwhite Added note about spec:generate task, which ensures rspec_scaffold con…
authored
18 * rspec compat: Added new rake task to test that an RC controller passes the default rspec_scaffold
19 controller specs.
20
10eaea5 @ianwhite Fixed failing regression spec in edge
authored
21 * Added BC for 2-0-stable branch re: find_filter, and regression specs
22
23 * find_filter no longer exists in edge - updated accordingly [Jason Lee http://github.com/jlsync]
24
46db2a1 resources_controller: Added ability to pass options to named route in…
ian authored
25 * Added ability to pass options to named route in form_for_resource
26
27 form_for_resource :url_options => {:gday => 'mate'}
28
29 # => action="/products/1?gday=mate" (for update)
30 # => action="/products?gday=mate" (for create)
31
1dca758 resources_controller: * changed :erp to :resource_path, and added :re…
ian authored
32 * changed :erp to :resource_path, and added :resource_method.
33
34 This means you can connect a named route up with a REST action and also change the method
35
36 map.activate_account '/activate/:code', :controller => 'activations', :action => 'create', :resource_path => '/activations', :resource_method => :post
37
38 :erp retained for BC
39
40 * save_resource and resource_saved? added. These simply save the resource and cache
41 the result of that save. This means you can use the result of the resource save in your
42 response_for blocks (if you're using response_for)
43
44 response_for :create do |format|
45 if resource_saved?
46 format.html {}
47 else
48 format.html {}
49 end
50 end
51
52 def create
53 self.resource = new_resource
54 save_resource
55 end
56
cfa3d5e resources_controller: added Ardes::ResourcesController.actions and
ian authored
57 * added Ardes::ResourcesController.actions and
58 Ardes::ResourcesController.singleton_actions accessors so you can set the
59 default actions module across your app
60
dd20dcd resources_controller: Added resource_saved? method to controller. Th…
ian authored
61 * Added resource_saved? method to controller. This is useful for sharing the
62 result of a save outside action methods (for example in response_for blocks)
63
8447d4c resources_controller: added error_messages_for_resource to Helper
ian authored
64 * added error_messages_for_resource to Helper
65
66 * fixed form_for_resource when resource is new and controller is for singleton
67 resource
68
6f90688 resources_controller: added :erp patch, doc and specs [thanks Chris H…
ian authored
69 * added :erp patch, doc and specs [thanks Chris Hapgood for the initial patch]
70
71 Use the :erp param when you are routing a non RESTful route to your rc controller
72 This allows rc to load the resources using the route.
73
74 e.g. map.home '', :controller => 'forums', :action => 'index', :erp => '/forums'
75
c3af167 Removed deprecated options (in r492 - I forgot to say so)
ian authored
76 * Removed deprecated options (in r492 - I forgot to say so)
77
fc13862 resources_controller: coverage back to 100%
ian authored
78 * Coverage back to 100%
79
1b8be92 resources_controller: you can alias an enclosing resource with :as
ian authored
80 * you can alias an enclosing resource with :as
81
82 This can be useful when you have a tree like domain:
83
84 map.resources :categories do |category|
85 category.resources :categories
86 end
87
88 class CategoriesController < ApplicationController
89 resources_controller_for :categories
90 map_resource :category, :as => :parent
91 end
92
983e0df resources_controller: you can now specify which actions are loaded fr…
ian authored
93 * you can now specify which actions are loaded from the actions module
94
95 resources_controller_for :forums, :only => [:index, :show]
96 resources_controller_for :forums, :actions => MyActions, :except => :destroy
97
98 The method used to achieve this is Ardes::ResourcesController::include_actions
99 which can be used in any ActionController when resources_controller is in your
100 plugins directory
101
44316d0 resources_controller: - :polymorphic => true is back:
ian authored
102 * - :polymorphic => true is back:
103 resources_controller_for :tags
104 nested_in :taggable, :polymorphic => true
105
106 This will load the enclosing resource (which can be a mapped resource) as
107 @taggable as well as its default name
108
109 The following syntax is equivalent to the above two lines:
110 resources_controller_for :tags, :in => '?taggable'
111
112 And you can specify a single wildcard '?' as well as expanding wildcards '*':
113 resources_controller_for :images, :in => '?', :load_enclosing => false
114 # this will work for routes like /users/1/images, /forums/2/images, /featured/images
115
116 - test coverage is up
117
118 - moved some of the 'friend' functionality out of Specification, as it smelt bad
119
e8fc191 resources_controller: added specs for when you want to find_by_(somet…
ian authored
120 * added specs for when you want to find_by_(something other than id) (users,
121 addresses, interests)
122
123 Fixed a bug where the resource mapping was using name instead of segment to
124 match when a map should be used (this meant mapping didn't work for non
125 singleton resources)
126
127 Thanks to Inviz <invi...@gmail.com> and Matt Mower <matt.mo...@gmail.com>
128 in http://groups.google.com/group/resources_controller/browse_thread/thread/b71b2ce196a09d15
129 for the bug reports
130
6bf2334 resources_controller: Updated actions to be more in line with recent …
ian authored
131 * Updated actions to be more in line with recent rails scaffold [Jason Lee <jlsync@gmail.com>]
132
604a147 resources_controller now uses before_filter (instead of prepend_befor…
ian authored
133 * resources_controller now uses before_filter (instead of prepend_before_filter)
134 for load_enclosing_resources. So the resources will be loaded at the point
135 where resources_controller_for is specified. However, it only adds the
136 filter if it's not already there - so you can play around with the order if
137 you need to:
138
139 prepend_before_filter :load_enclosing_resources
140 resources_controller_for :foos
141
142 (common case for the above is where superclass defines filters that need
143 access to enclosing resources)
144
1c137a5 reosurces_controller: resources_controller_for can now be specified m…
ian authored
145 * resources_controller_for can now be specified more than once in a controller
146 heirachy. The latter definition will overwrite the previous one, and will
147 also 'reset' the nestings.
148
1dada75 resources_controller: First stab at namespace support:
ian authored
149 * First stab at namespace support:
150 map.namespace :admin do |admin|
151 admin.resources :forums
152 end
153
154 module Admin
155 module Forums < ApplicationController
156 resources_controller_for :forums
157 end
158 end
159
160 in an action:
161 resources_path # => '/admin/forums'
162 enclosing_resources # => []
163
f8a3878 Minor doc improvements
ian authored
164 * Minor doc improvements
165 Speced better js response on edit and new actions [Jason Lee <jlsync@gmail.com>]
166
0059502 resources_controller: The Routing patch has been removed from RC as i…
ian authored
167 * The Routing patch has been removed from RC as it has been accepted and applied to edge (#8930).
168 This is not a dependency of RC, but it is of the specs - so grab latest edge to run them.
169
2200ba9 * Major internal changes, and some API change: see the rdoc for details.
ian authored
170 * Major internal changes, and some API change: see the rdoc for details.
171 The headlines:
172 - load_enclosing is now true by default
173 - BC: the old options work for now, but you'll get deprecation messages
174 - refactored a lot of code into friend classes - in particular there is now
175 ResourcesController::Specification which specifies how to find a resource from the route
176
1dc4d3f resources_controller:
ian authored
177 * Fixed some problems with internals of RC when :load_enclosing => true
178
68ddf96 * resources_controller now supports singleton resources! and much be…
ian authored
179 * resources_controller now supports singleton resources! and much better :load_enclosing support
180 Booya! =>
181 class TagsController < ApplicationController
182 resources_controller_for :tags, :load_enclosing => true
183 end
184
185 this will service all these routes (loading the resources into assigns for the view)
186
187 /tags
188 /forums/2/tags
189 /images/1/tags
190 /home/tags <= singular resource
191 /users/1/image/tags <= nested singular resource
192
193 Also
194
195 class BlogController < ApplicationController
196 resources_controller_for :blog, :singleton => true, :load_enclosing => true
197 end
198
199 class PostController < ApplicationController
200 resources_controller_for :post, :load_enclosing => true
201 end
202
203 for /campaigns/1/blog
204 /users/2/blog
205 /campaigns/1/blog/posts
206 /users/2/blog/posts
207
208 etc...
209
210 TODO: rewrite docs - for now check out the spec suite.
211 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'
212
48c58cd resources_controller:
ian authored
213 * resources_request has changed format - it now returns an array like this
214 [ {:name => "forums", :name_prefix => "forum_", :key => :forum_id, :id => "1"}, {:name => "posts"}]
215 Singular resources are detected properly (see spec/specs/resources_controller_spec for some tests).
216 This paves the way for singular_resource support, and better 'many routes/one controller' support
217
218 Decided that Patching Routing was a bad idea, so route is re-recognized using the request path. This
219 only happens for controllers with :load_enclosing => true
220
18e3939 resources_controller:
ian authored
221 * You can now call methods such as enclosing_resource_path, enclosing_resources_path, etc
222 in your controller and view and the correct url helper will be called. These url_helpers are defined
223 as they are needed, so it's pretty fast.
224
225 * Removing routing decoration for now
226
f4f78c8 resources_controller
ian authored
227 * Enclosing resources are now all loaded by one method :load_enclosing which is a prepend_before_filter.
228 This means that you can access the enclosing resources in all before_filters, even when a subclass adds
229 more nestings.
230
231 Example:
232
233 class PostsController < ApplicationController
234 resources_controller_for :posts
235 end
236
237 class UserPostsController < PostsController
238 nested_in :user
239
240 before_filter {|c| raise 'boom' if @user.name == 'Santa'}
241 end
242
f3d7fc4 resources_controller:
ian authored
243 * Removed ResourceService proxy class. This was mainly used for BC with rails <= 1.2.2. If you're
244 using this, then freeze to r377 of resources_controller. The resource_service is now either an
245 ActiveRecord or association proxy.
246
247 * Added route decoration to access the recognized route in the controller (for future parsing of
248 singular resources, and better polymorphic support)
249
bee172f resources_controller: Removed Ardes::ResourcesController::Spec::ViewH…
ian authored
250 * Removed Ardes::ResourcesController::Spec::ViewHelper as it's best to not have a dependency
251 like this in your specs. Just stub out the resource methods that are needed by that view,
252 or use the default assigns.
253
0c5fcae Named path support is much improved. All named routes for the curren…
ian authored
254 * Named path support is much improved. All named routes for the current resource can be
255 called by substituting 'resource'. E.g. the following methods in your controller or
256 view will work: :formatted_resource_path, :preview_resource_path (if :preview is in :member),
257 :resource_tags_path, etc, etc.
258 This helps with decoupling the model name from the controller and view.
259
8cf4bad resources_controller: Added flash tests [frederikfix at eml dot cc]
ian authored
260 * Added flash tests [frederikfix at eml dot cc]
261
1535036 resources_controller: Added rjs actions [frederikfix at eml dot cc]
ian authored
262 * Added rjs actions [frederikfix at eml dot cc]
263
1f3e3f4 Added Ardes::ResourcesController::Spec::ViewHelper for easy view testing
ian authored
264 * Added Ardes::ResourcesController::Spec::ViewHelper for easy view testing
265
100ae48 Added Helper#form_for_resource for easy form generation, see rdoc for…
ian authored
266 * Added Helper#form_for_resource for easy form generation, see rdoc for details
267
b7750a5 * Enclosed named paths use the new edge rails conventions for named r…
ian authored
268 * Enclosed named paths use the new edge rails conventions for named routes.
269
270 So to get the path to edit a child tag resource (where resource is 'forum:1')
271 edit_resource_tag_path(@tag) # => '/forums/1/tags/2/edit'
272
273 * Handles options passed to named routes
274
275 resource_path(:sort_by => 'article') # => '/forums/2?sort_by=article'
276
0181a4a Now handles enclosing named paths. You can reference named routes th…
ian authored
277 * Now handles enclosing named paths. You can reference named routes that are
278 'below' (or enclosed by) the current resource by appending resource_ to that
279 named route. [thanks Chris Hapgood for the initial idea]
280
4e33aa8 resources_controller: (find|new)_resource(s) methods are now defined …
ian authored
281 * (find|new)_resource(s) methods are now defined by resources_controller_for only
282 if they do not already exist
283
84470fa resources_controller: Better regexp for resources_request [Chris Hapg…
ian authored
284 * Better regexp for resources_request [Chris Hapgood]
285
f042826 resources_controller: Added more specs to get coverage to 100%
ian authored
286 * Added more specs to get coverage to 100%
287
6dccf6a Upgraded specs for latest edge and rpsec 0.9, improved Rakefile and s…
ian authored
288 * Upgraded to rpsec 0.9, improved Rakefile and specs so that spec:plugins will work
289
4d8e78d Removed ApplicationController from spec/app.rb to avoid conflicts wit…
ian authored
290 * Removed ApplicationController from spec/app.rb to avoid conflicts with en-
291 closing rails application
292
20d4f25 Added method_missing proxy to ResourceService, to enable the resource…
ian authored
293 * Added method_missing proxy to ResourceService, to enable the resource_service
294 to be used for things other than find or new (for example Pagination) [Dan Kubb]
295
063f481 git-svn-id: https://svn.ardes.com/rails_plugins/resources_controller@…
ian authored
296 * Fixed small error in flash message of destroy action [Dan Kubb]
297
7a47cc1 Removing experimental cruft
ian authored
298 * Removing experimental cruft
299
6bf2334 resources_controller: Updated actions to be more in line with recent …
ian authored
300 * CHANGELOG started
Something went wrong with that request. Please try again.