-
Notifications
You must be signed in to change notification settings - Fork 307
How to add new activity objects
Social Stream allows developers to write and integrate custom models in the social network.
Social Stream components already provide your application with the most popular activity objects (for instance social_stream-documents
provides with files, pictures, audio and video support) These gems automatically integrate new activity objects with the rest of Social Stream, in the wall form, the search engine, etc.
Just include the desired components in your Gemfile.
Besides, some aspects can be customized in the file config/initializers/social_stream.rb
, which should be copied to your application in the install rake task, and should look like https://github.com/ging/social_stream/blob/master/base/lib/generators/social_stream/base/templates/initializer.rb
For adding new features on social_stream, remember:
-
All activity object models should
include SocialStream::Models::Object
and include anactivity_object_id
integer field in their table. -
Include them in
config/initializers/social_stream.rb
so they are available in for forms, search engine, etc. See the application'config/initializers/social_stream.rb
for more details. -
Once you create the activity object, it is necessary that you write some views for showing, creating, and managing the activity object. You can use the views under app/views/links in the linkser gem as reference for building your own views.