需要以下开发环境
在开始之前必须确定你的系统path正确指向到了Adobe Flex Sdk目录下
/Applications/Adobe Flex Builder 3/sdks/3.x.x/bin
C:\Program Files\Adobe\Flex Builder 3\sdks\3.x.x\bin
(以下是在win32环境下)。
首先创建你的项目
gem install restfulx rails -d mysql demo cd demo
编辑config/environment.rb并添加
config.gem "restfulx"
配置你的config/database.yml 文件
将数据库连接,设置为正确的方式,配置其用户名和密码
运行
ruby script\generate rx_config
创建 db\model.yml文件
location: - name: string - notes: text - belongs_to: [user] - has_many: [tasks] project: - name: string - notes: text - start_date: date - end_date: date - completed: boolean - belongs_to: [user] - has_many: [tasks] task: - name: string - notes: text - start_time: datetime - end_time: datetime - completed: boolean - next_action: boolean - belongs_to: [project, location, user] note: - content: text - belongs_to: [user] user: - login: string - first_name: string - last_name: string - email: string - has_many: [tasks, projects, locations] - has_one: [note]
运行以下应用
ruby script\generate rx_yaml_scaffold rake db:refresh rake rx:flex:build ruby script\server
可以看看效果了.
http://localhost:3000
======================
如何切换为AIR应用
ruby script\generate rx_config -a rake rx:air:build rake rx:air:run
如何切换回Flex应用
ruby script\generate rx_config
R Link: