Controller belongs_to model?

I’ve never seen this before:

class Admin::PaymentsController < Admin::BaseController
belongs_to :order
end

What does this mean, exactly?!

(This code is from Spree)

Thanks!

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

On Tue, Dec 29, 2009 at 9:28 AM, phil [email protected] wrote:

I’ve never seen this before:

class Admin::PaymentsController < Admin::BaseController
belongs_to :order
end

What does this mean, exactly?!

(This code is from Spree)

It’s from the plugin resource_controller and makes Payments a nested
resource under Order.

See the docs for resource controller
http://github.com/jamesgolick/resource_controller

alternatively, the readme for resource_controller is in the vendored
copy in spree in vendor/plugins


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.