Sign Up
Login
Home
Plugins
Gems
News
Job Board
Edit Usage
Plugin home
Submit new plugin
*
Title
*
Content
Summary To generate a scaffold for the model message with fields title and body: [terminal] > 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 [/terminal] 1. Install a REST service from flex_scaffold_resource Create an Active Resource (REST service) [terminal] > ruby script/generate flex_scaffold_resource message title:string body:string [/terminal] This simple command will generate a lot of stuff, in detail: * A controller with REST actions and an action for getting the schema * A model named message * A migration named xxx_create_messages * Fixture and unit tests for the model and the controller * A line in your config/routes.rb file map.resources :messages Alternatively, you can add scaffolding to any REST resources by adding to any controller: [code] flex_scaffold :message [/code] Note: You can then delete or extend all the other REST actions as they are implicitly scaffolded 2. Migrate the database [terminal] > db:migrate [/terminal] This updates the database ready for the scaffold to pick up the columns. 3. Create the scaffolds [terminal] > ruby script/generate flex_scaffold message [/terminal] This will generate: * A scaffold view for the controller which loads the swf * A template layout for the controller * Scaffolded mxml files (in app/flex) 4. Compile the scaffolds [terminal] > rake flex:app mxml=messages [/terminal] This will generate: * copy assets into the /app/flex/<model> folder ready for compilation (see below) * compile the swf files based on the configuration in the related controller to /app/flex/<model> * save the resulting swf in /public/swfs/flex_scaffold * ensure that all needed public assets are copied to /public/ [stylesheets, javascript] (also see Restart server below) This Rake task infact copies the necessary assets into the build folder </tt>/app/flex</tt> and then remove when finished. To avoid you compile only. This would involved steps either side for use: [terminal] > rake flex:build:install mxml=contacts [move the assets into the build structure] > rake flex:compile mxml=contacts [repeat this as many times as needed] [/terminal] Optionally you may wish to clean up: [terminal] > rake flex:build:clobber mxml=contacts [/terminal] Note: There is currently no way to build multiple scaffolds at one time. 5. (Re)Start server? Just check this. You should only need to restart the start to init the plugin. This will also copy the correct files to public which is equivalent to the Rake task: rake flex:public:install
How do I format code and text?
To check that you are human, please answer the following question.
*
Five times two is what?
Plugin Links
Flex Scaffold home
Usage
General Design Notes
Plugin Search
Plugin Tags
ACL
acts
Admin
AJAX
amazon
api
assert
asset
association
attribute
Auth
Authentication
browser
Cache
Calendar
Captcha
column
config
CRUD
CSS
data
Database
Date
default
editor
email
exception
filter
find
fixture
flash
form
format
FormHelper
generator
Geo
Gibberish
Google
graph
HAML
helper
HTML
http
image
Images
input
Javascript
label
list
log
Login
mail
Maps
message
migration
Migrations
model
monitor
mysql
number
Sponsors