I'm new to rails & am building out an application to learn from. From
a conceptual perspective, how would I go about working with a subset
of data? For example, say I have an application with basic CRUD
operations on "Stuff". I've implemented the restful_authentication
plugin and am now struggling with how would I deal with setting up
CRUD for "MyStuff" (i.e. Stuff associated with a particular user ID).
What's the best approach? Any good examples/tutorials out there?
Following are thoughts I'm considering:
- Recreate the controller & views for "Stuff", but just using the
subset of data associated with the user's ID.
- as a subset to this, I see the "Stuff" controller is "class
StuffController < ApplicationController". Do I want to set
up something like "class MyStuffController < Stuff
Controller". Is this possible?
- I've read on various the web pages about filtering, but not sure I
understand it fully. Can this be used?
Really I'm just working with a subset of "Stuff", and I'd think I
should be able to re-use the controller, views, etc.
by just passing it a different data set, but then maybe this is a
naive perspective.
- Is this an inheritance concept?
Thanks in advance for your guidance!
--
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.