Posted By: Todd
Date: 2007-04-06 10:11
Summary: FlexScaffold 0.1.0
Project: Flexible Rails= flex_scaffold RESTfully
=FlexScaffold
Flex Scaffold should allow you to swap in and out different view layers on your REST controller.
For example, to use the model <tt>contact</tt>, use <tt>flex_scaffold: contact</tt>
class ContactsController < ApplicationController
layout 'flex_scaffold'
flex_scaffold :contact (optional - :size => '800x600')
# The following line can be used instead of the generated definitions
# of index, show, new, edit, update, destroy. There is also the action
# schema to look at the data model
...
end
Other files that are created:
/app/flex/contacts/_list.mxml
/app/flex/contacts/_contacts.mxml <-- these are compiled to a swf file
/public/swfs/flex_scaffold/_contacts.swf <-- created via rake flex:app mxml=contacts
/app/views/layout/flex_scaffold.rhtml <-- templated pages
/app/views/flex_scaffold/index.rhtml <-- loads up the swf
==USAGE
===Summary
To generate a scaffold for the model <tt>message</tt> with fields <tt>title</tt> and <tt>body</tt>:
> ruby script/generate flex_scaffold_resource message title:string body:string
> rake db:migrate
> ruby script/generate flex_scaffold message
> rake flex:app mxml=messages
> ruby script/server start
===Phase I (complete)
* tie in REST (resource) generation for flex_scaffold
* scaffold model for flex viewing (flex_scaffold)
* generate mxml files for model
* compile swf
* transfer swf to public folder
* load page which points flash file (use JavascriptHelper in openLaszlo)
* add CRUD actions on controller
* add return schema onto controller
|
|