Skip to content

How to add new activity objects

Reydel Leon edited this page May 27, 2013 · 8 revisions

Social Stream allows developers to write and integrate custom models in the social network.

Activity objects already available

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

Creating new activity objects

For adding new features on social_stream, remember:

  • All activity object models should include SocialStream::Models::Object and include an activity_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.

Clone this wiki locally