Starting with Crabgrass and developing new features

(Updated on 2012/07/04)
Done by newbie for newbies

Ruby and rails

Ruby documentation:

Rails documentation: (note the version)

Ruby/Rails books:

Starting with Rails

rails demo
cd demo
rake db:create
ruby script/server
ruby script/generate controller Say
script/generate controller home index
rm public/index.html
vim config/routes.rb

default routes:
map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' 
map.root :controller => "home"

rails generate scaffold User name:string email:string

script/generate scaffold Post name:string title:string content:text

rake db:migrate

vim /app/views/home/index.html.erb

Starting with Crabgrass

Official website:

The official code: (this other is the same, is synchronized:

My code with the new features in branches:

The issue tracker:

My reported bugs:

API documentation (generated with rdoc, from old crabgrass version):

Lastest documentation (in the source code):

Documentation that anybody can generate in the Crabgrass Dev Network in Crabgrass:

Contact developers:

Interesting pages to read (though might be unupdated)

New crabgrass documentation

Coding Standards

Crabgrass and git how to

Git Branches and Crabgrass Dev Process



Rails peculiarities in Crabgrass

  • The Rails version used is 2.3.11
  • Some Rails conventions are not followed, when creating modules in /lib are not in the global namespace
  • Gem dependencies are not in Gemfile
    • Gems are specified in the config/environment.rb file
  • Rails is not using bundle
  • Some routes are not resful

Hands on the code

Howto install Crabgrass

Using rbenv: Install crabgrass using rbenv

Install also etherpad-lite for using the pad pages: FIXME

Create and run tests

rake db:test:prepare
ruby test/unit/user_test.rb -n blue

test are created inside:


Using the console

>>'/session/login', {:user => 'blue', :password => 'blue'}
>> app.cookies
>> app.session
>> PadPage.last
>> PadPage.all
>> u = User.find(4)
>> g = Group.find(2000)
>> p =
>> p = => "newpad", :created_by_id=> 4, :updated_by_id => 4, :updated_by_login => 'blue', :created_by_login => 'blue', :owner_id => 2000, :owner_type => 'Group', :owner_name => 'private_group')
>> epg =


don’t forget to install “gem INSTALL ruby-debug”

add “debugger” to the code where u want to start the debugger

run Crabgrass with “—debug”

then you will get a console where can print variables, see the trace, etc.


Generate model diagram

gem install railroady

railroady -v -M -b | /usr/bin/dot -Tpng > models.png

Using git

Example session using Crabgrass git

Anonymous delegation

Crabgrass modifications to add anonymous delegation

Etherpad-lite demo page with video

Crabgrass modifications for a demo page with video and a pad

Etherpad-lite integration in Crabgrass

Etherpad-lite integration in Crabgrass

Tags in every picture

Crabgrass modifications to add picture tagging

Pads in every picture

Crabgrass modifications to add pads to each picture in gallery

Federation using XMPP PubSub

Crabgrass federation using XMPP PubSub


deploy crabgrass

There must be some way to speed more cg

How cache works?