https://github.com/cbeer/blacklight_user_generated_content
https://github.com/cbeer/blacklight_user_generated_content
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cbeer/blacklight_user_generated_content
- Owner: cbeer
- License: mit
- Created: 2010-10-15T19:46:52.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2011-10-04T14:04:06.000Z (over 14 years ago)
- Last Synced: 2025-01-23T02:59:21.812Z (12 months ago)
- Language: Ruby
- Homepage:
- Size: 133 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# Blacklight
This is a plugin for [Blacklight](http://projectblacklight.org) that adds a basic layer of ActiveRecord-esque mocking to a Blacklight::Document/RSolr::Ext::Model class that allows it to work seamlessly with (some) extant Ruby on Rails plugins to provide "user generated content" features.
Currently, acts-as-taggable-on and acts_as_commentable are two integrations supplied by the plugin, although additional integrations should be trivial.
## Installation
(Add blacklight_user_generated_content to your gemfile)
$ rails generate blacklight_user_generated_content
generate cancan:ability # cancan authorization framework
create app/models/ability.rb
insert app/models/ability.rb
generate acts_as_taggable_on:migration
create db/migrate/20110228210334_acts_as_taggable_on_migration.rb # acts as taggable expects the taggable_id to be an int. A solr document primary key may also be a string.
create db/migrate/20110606124459_alter_taggable_id_to_string.rb
generate comment
create app/models/comment.rb
insert app/models/comment.rb
insert app/models/solr_document.rb
$ rake db:migrate
Through the Rails Engine framework, this plugin also provides resourceful controllers for tags and comments, and provides an example catalog index of user generated content.
## TODO
This plugin depends on 'cancan', an authorization framework, to restrict Comment management to the original author. Ideally, this would either be optional or pluggable.
The user generated content "index" currently requires additional information to be indexed within Solr. This integration is not provided by this plugin, however, which may limit its utility.
This plugin has only been tested against master/HEAD versions of acts-as-taggable-on and acts_as_commentable. Some stable releases of these plugins have known issues.