new_resource do |widget|
widget.foo = "bar"
end
The fix is so trivial, I won't bother writing it out (particularly
since I'm not an rspec'er)
------------------
A suggestion: custom actions module should also support custom find/
new_resource methods. Unfortunately, if you put a custom new_resource
method in an action module, it still gets overridden by the default.
class FeedsController < ApplicationController
resources_controller_for :feeds, :actions
=> ::Hapgood::OwnedDataActions
end
does not work. Here is my workaround:
class FeedsController < ApplicationController
include ::Hapgood::OwnedDataActions
resources_controller_for :feeds, :actions => false
end
-Chris
A solution would be to move the RC version of new_resource to a module
and include that module BEFORE including the actions module.
This is definitely nit-picking though. The only reason I need it now
is to wire in support for block initialization.
> A solution would be to move the RC version of new_resource to a module
> and include that module BEFORE including the actions module.
This is a good idea, and something I've been meaning to do for a while
anyway - it will also allow super calls when you;re overriding
find_resource ect.
Cheers,
Ian
> --
>
> You received this message because you are subscribed to the Google
> Groups "resources_controller" group.
> To post to this group, send email to resources_...@googlegroups.com
> .
> To unsubscribe from this group, send email to resources_contro...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/resources_controller?hl=en
> .
>
>
Both of these issues are now fixed - please try them out and let me
know how it goes. Here's the spec that tests these features: http://github.com/ianwhite/resources_controller/blob/master/spec/lib/resource_methods_spec.rb
Cheers,
Ian
As usual, Ian is on top of his game!
PEOPLE: spread the word, this RC thing is truly useful.
On Dec 20, 5:01 am, Ian White <ian.w.wh...@gmail.com> wrote:
> Hi Chris,
>
> Both of these issues are now fixed - please try them out and let me
> know how it goes. Here's the spec that tests these features:http://github.com/ianwhite/resources_controller/blob/master/spec/lib/...