Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.
dima edited this page Aug 14, 2010 · 26 revisions

Status

Ruboss framework unified Rails/Merb integration support is currently in active development. Expect to see some progress in the next few weeks.

Getting up and running with the Ruboss framework and Merb

What you’ll need:

  1. Merb 0.9.3+ (merb-core, merb-more, merb_activerecord (part of merb-plugins))
  2. Flex SDK 3.0 (add Flex SDK bin folder to your $PATH variable)
  3. Git
  4. MySQL 5.0+

1. Do:


$>merb-gen app pomodo $>git clone git://github.com/dima/ruboss_on_ruby.git $>cd ruboss_on_ruby $>rake install_gem

2. Now edit pomodo/config/init.rb (pomodo is the new merb application we’ve just generated):

  • add dependency "ruboss_on_ruby"
  • uncomment use_orm: activerecord

3. Set up the database anyway you like. E.g.:


mysql>create database pomodo_development

4. Configure ruboss environment:


$>merb-gen ruboss_config

4. Create a new merb resource:


$>merb-gen resource project name:string notes:text start_on:datetime

5. Load some data. E.g.


$>mkdir -p spec/fixtures $>touch spec/fixtures/projects.yml

Edit spec/fixtures/projects.yml to contain the following:


one: name: Hello World notes: Some Notes

two:
name: Good Bye World
notes: No Notes Here


Then run:


$>rake db:migrate $>rake db:fixtures:load

6. Edit the generated controller in app/controllers/projects.rb to contain:


class Projects < Application provides :fxml
  1. provides :xml, :yaml, :js
def index @projects = Project.find(:all) display @projects end …

end


Note provides :fxml at the top of the class.

7. Run merb


$>merb

OK, we can now navigate to http://localhost:4000/projects.fxml and validate that XML returned conforms to Ruboss XML-over-HTTP provider API requirements

8. Open up pomodo in Flex Builder and start hacking away on models, components, etc.

Notes

  1. The steps above assume that you are using ActiveRecord with Merb. Another popular choice is DataMapper, which still needs to be patched in a way that is consistent with Ruboss API requirements.
  2. Default create, update and destroy methods are most likely to not work unless the generated Merb RESTful controller methods are updated in line with Ruboss XML-over-HTTP provider requirements.
  3. Not all of the Ruboss Rails generators have been ported to Merb yet so you’ll have to create Flex models and components manually at the moment. For details start with the instructions over at: Ruboss framework + Ruby on Rails and copy/use the Flex code generated there.
Clone this wiki locally