“Advanced” installation of RestfulX into your Rails app

After you create your Rails project using rails , you can configure it to use RestfulX using the command script/generate rx_config. This command creates all the configuration files and downloads the RestfulX library file (restfulx_framework.1.2.4.swc, the current version while I write this post).

Alternatively you can also download the sorce of the restfulx_framework project and include it in your Flex project. To do so, use git to download the source: git clone git://github.com/dima/restfulx_framework.git. Now you shoud create the configuration files using this command: script/generate rx_config --skip-framework. The --skip-framework tells the rx_config command to generate the config files without trying to hit the server to download the framewokr library.

If you import your recently created RestfulX project into Flex Builder you’ll see an error: FB can’t find the class RxApplicationController. This happens because you didn’t downloaded the RestfulX library. To fix that, you need to configure your project to use the source code downloaded early. To do that click the Project menu and the option Properties. Select Flex Build Path. At the Source path tab click Add folder… and find the framework/src folder, that is inside the RestfulX’s directory. Click Ok and this folder will be part of your project’s source code.

Now you must tell the FB where are the libraries used by RestfulX. Select the Library path tab and click Add swc folder…. Find the framework/lib folder (that is also inside the RestfulX’s directory)

Just to remember: when you import your project into Flex Builder, point this to your Rails root folder. There is the project configuration file there, that tells to FB to use the lib folder as the source for libraries, the app/flex as the source folder to your Flex application, and the public folder as the default target directory for your compiled project. Then, after you compile your application, start the Rails server using script/server and go to http://localhost:3000 to see your application working.

An important detail: all these downloads and configurations will be necessary only if you want to use the source code of the RestfulX framework. This is handy if you want to debug your application and see what happens inside the framework. If you don’t want to do all these configurations simply run script/generate rx_config (as shown at the start of this article) and RestfulX will do the work for you!


Poderia avaliar este artigo, por favor?

1 Estrela2 Estrelas3 Estrelas4 Estrelas5 Estrelas (Nenhum voto)
Loading ... Loading ...

Posts relacionados