Loading...

communityengine@googlegroups.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: [CommunityEngine] How to extend CE so registered users can create a collection of items? Bruno Bornsztein Mon Aug 30 06:00:32 2010

Hi guys,
This is really a Rails question; most of what you want to know is not
directly related to CE.

Basically, you just add on to the CE User model by creating a user.rb file
in your app/models directory. Any methods you add there will be added to
User. Any methods that have the same name existing CE User methods will *
override* the CE method.

The other important thing is to have your new Controllers inherit from
BaseController (if you want to reuse the default CE layout, filters and
helpers). Beyond that, it's just like any Rails app.

Good luck!
Bruno




On Sun, Aug 29, 2010 at 10:41 AM, Jim Ruther Nill <[EMAIL PROTECTED]> wrote:

> Just my two cents, ok?
>
> What you need is two models. Collection and Item.
>
> Basically, a
>
> class Collection < ActiveRecord::Base
>   has_many :items
>   belongs_to :user
> end
>
> class Item < ActiveRecord::Base
>   belongs_to :collection
> end
>
>
> The tricky part is the attributes for each model.  For the collection
> model, some of the things you need/want answered are:
>
>    - attribute name for the collection name (most probably :name)
>    - user_id
>    - status (private, visible to friends, etc.)
>
>
> For the item model, this should be very flexible since you don't know what
> collection your users would add (or do you?)
>
>    - collection_id
>    - name of the item
>    - description of the item
>    - anything specific you want to add
>
>
> Good Luck!
>
>
>
> On Sun, Aug 29, 2010 at 5:00 AM, RolfeDH <[EMAIL PROTECTED]> wrote:
>
>> Could you provide an overview of how to extend CE so that registered
>> users can create collections of items. For example, a rock
>> collection.
>>
>> They could:
>> - Add or remove items from the collection.
>> - Make the collection private, visible to friends, or visible to any
>> registered user.
>> - Maybe create multiple collections.
>>
>> I'm a Rails newcomer and am using Agile Web Development with Rails,
>> Third Edition, by Sam Ruby et Al. as my learning and reference guide.
>> I'll research any high-level information you provide here.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "CommunityEngine" group.
>> To post to this group, send email to [EMAIL PROTECTED]
>> To unsubscribe from this group, send email to
>> [EMAIL PROTECTED]<[EMAIL PROTECTED]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/communityengine?hl=en.
>>
>>
>
>
> --
> -------------------------------------------------------------
> visit my blog at http://jimlabs.heroku.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "CommunityEngine" group.
> To post to this group, send email to [EMAIL PROTECTED]
> To unsubscribe from this group, send email to
> [EMAIL PROTECTED]<[EMAIL PROTECTED]>
> .
> For more options, visit this group at
> http://groups.google.com/group/communityengine?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"CommunityEngine" 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/communityengine?hl=en.