PublikaOpinio ============= PublikaOpinio is a bookmark based on tag built like plugin for ruby on rails. Requirements =========== Built and used with: Ruby 1.8.6 Rails 2.0.2 Rails 2.1 MySQL: 5.0.41 Install ======= 1) Copy PublikaOpinio directory in vendor/plugins/ directoriy of a new rails project 2) Configure your config/database.yml 3) copy vendor/plugins/db/migrate directory in db/ and run "rake db:migrate" from your project directory or create your table whit this sql: CREATE TABLE `bookmarks` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, `url` varchar(255) default NULL, `description` varchar(255) default NULL, `tags` text, `private` char(1) default NULL, `created_at` datetime default NULL, `updated_at` datetime default NULL, PRIMARY KEY (`id`) ) 4) Add this line to config/routes.rb (before the final end) map.root :controller => 'bookmarks' map.resources :bookmarks map.namespace :admin do |admin| admin.resources :bookmarks end 4) Add this line to config/environment.rb (before the final end) $myregexp = /^[a-zA-Z0-9+\s]*$/ 5) Remove index.html from the public directory 6) Run "script/server" from your project directory for start Configure ========= - $myregexp is the "regular expression" that I choosed for skip sql injection (http://en.wikipedia.org). I used the same expression for the back-end and the front-end. You can change it in config/environment.rb - I used HTTP Basic Authentication for the secure area. Use your preferred login system or just remember to change user and password (admin - admin) in app/controllers/admin/bookmarks_controller.rb - You can choose wich fields show/hide in app/view/bookmarks/index.html.erb: Comment/uncomment the query results. Use ==== - If you type a single tag you'll find an exact tag - If you type a single tag with the & box checked you'll find an exact tag and the tags with that suffix/prefix - If you type multiple tags (separated by space) you'll find bookmarks with one or more tags - If you type multiple tags (separated by space) with the & box checked you'll find bookmarks with one or more tag and the tags with that suffix/prefix - If you type multiple tags with + (plus) like separator you'll find the bookmarks with all the tags - If you type multiple tags with + (plus) like separator and with the & box checked you'll find the bookmarks with all the tags and the tags with that suffix/prefix Note: a tag is considered a single word and the space is used like separator. Thanks for your interesting. M.B. http://bersani.eu Copyright (c) 2008 bersani.eu , released under the MIT license