Hobo Tutorial

Hobo tutorials index.

Aim of this page is a "cheat-sheet" for the Agility tutorial, with my modifications.

Generate a basic app using Hobo

  1. sudo gem source -a http://gems.rubyforge.org
  2. hobo MyApp; cd MyApp
  3. ./script/generate hobo_migration
  4. ./script/server; create user and login
  5. ./script/generate hobo_model_resource Organism name:string binomial:string
  6. ./script/generate hobo_model_resource Enzyme name:string organism_id:integer (organism:references doesn't work)
  7. Edit app/models; Organism has_many :enzymes, Enzyme belongs_to :organism
  8. ./script/generate hobo_migration

Refresh web page. Should now have basic CRUD forms for Organism + Enzyme, with correct associations.

Extras
Nested resources + routes

  1. Edit enzymes_controller: auto_actions_for :organism, [:create, :new]
  2. Edit viewhints/organism_hints.rb: children :enzymes

Can now view and add enzymes for an organism.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License