My favorites | Sign in
Project Logo
                
Search
for
Updated Nov 10, 2007 by ernest.micklei
SetupRailsService  
Getting Started with the Rails implementation of the Pocogese service framework.

Introduction

The pocogese-rails project contains a Rails plugin

Details

In order to implement your Controllers for a Rails ActionController based Service, you need to:

  1. generate a scaffold ActionController using rails generate controller YourDomainClass
  2. tell the controller to use the pocogese api
  3. for each Selection request, add a selection_api declaration
  4. for each Command request, add a command_api declaration

Examples

class UserController < ApplicationController
  pocogese :user

  selection_api :getAllUsers

  def getAllUsers
    User.find(:all)
  end

  command_api :changePassword, :user_login, :old_password ,:new_password

  def changePassword(user_login,old_password,new_password)
     # ... stuff deleted
     Reply.ok("password changed")
  end

Fire up your rails server and already you can try out selections

http://localhost:3000/user/service/getAllUsers

Next

GenerateFlexFromRails to create ActionScript classes for each Controller that uses Pocogese


Sign in to add a comment
Hosted by Google Code