Using the Ruby On Rails plugin from FlashBuilder4
Make sure you followed the post Installing Ruby On Rails plugin for FlashBuilder4 for installing the plugin and setting up of your Rails project before proceeding with the usage of the plugin from FlashBuilder.
Using the plugin from FlashBuilder4:
1. Create a new Flex Project.
-In the New Project Wizard, name the project, lets say "TestROR", select the application type and make sure that you enter Application Server type as None/Other, click next.
-Enter the output folder to be something under the publicly accessible directory under your rails project, ex: C:\RubyProjects\myrailsproject\public\TestROR, click next
-Enter the Output folder url as the url which points to the output folder created above ex: http://localhost:3000/TestROR
Exit the wizard by clicking finish.
2. Creating a new Service
- In the Data/Services Panel click Connect to Data/Service..., when the Connect to Data/Service wizard opens select "ROR" icon and click next.
- On the next page, select the services folder. The services folder is the directory under which any ruby class will be exposed as a service. For "WebOrb" as the AMF library this will reside under the app folder under the project folder. ex: C:\RubyProjects\myrailsproject\app\services
Provide the AMF endpoint. By default the plugin assumes that the AMF library is WebOrb and the user will be using the default destination. You can change it to provide the endpoint of the destination of your choice.
You can then select between creation of a new service or import of an existing service.
Selecting "Generate a new Ruby service class from a model" means that the plugin will generate a class exposing all the CRUD(create,read,update,delete) functions as a service for the mentioned model. This class will be placed under the already mentioned services folder.
You will then provide the name of the model. The name of the model is the same that is used in the common ruby command ruby script/generate model modelname . The model name here corresponds to the underlying database table. Rails naming convention makes the table name to end with a "s" while the model name does not have the "s" ex: If the table name is "Users" the model name will be "User".
You can then select if the model already exists or not. If you select that the model exists then the model class won't be generated, otherwise the user will then need to provide the directory where the model class will reside on generation. Generally it is under the app folder under the project folder ex: C:\RubyProjects\myrailsproject\app\models
Selecting "Import an existing Ruby service class" will simply import the mentioned class without any server side code generation. The ruby file location should be under the mentioned services folder for it to be exposed as a service.
Click finish.
3. Using the created service
The created service will appear in the Data/Services panel. All the operations in the service class and the model class will be imported.
If you selected ""Generate a new Ruby service class from a model" in the previous step you will find that the service is automatically created with DataManagement on the model as turned on, with the paging function also assigned.
If you selected otherwise only the operations will get listed and no data types will appear. All the operations will also be weakly typed (unknown input types and return types). You will have to manually configure the return types using Configure Return type... on right clicking on the operations.
Using this service is same as using any other service under the DCD workflow in FlashBuilder4.Find more about DCD service usage and data management at http://sujitreddyg.wordpress.com/flash-builder-4

thanks for your great tutorial. However I cannot get it running with RubyAMF instead of WebORB.
Whenever I want to configure the service I get the following error on the rails console:
Processing RubyamfController#gateway (for 127.0.0.1 at 2009-12-07 17:07:54) [POST]
Sending data
Completed in 68ms (View: 1, DB: 0) | 200 OK [http://localhost/rubyamf/gateway]
>>>>>>>> RubyAMF >>>>>>>>> #<RubyAMF::Actions::PrepareAction:0x1044cd380> took: 0.00010 secs
uninitialized constant FBIntrospectionServiceController
....
Where can I get this FBIntrospectionServiceController?
Thanks in advance,
Markus
INFO: unable to load source file, FbController, hopefully Rails has already loaded it.
ERROR: Exception processing request. Destination: FbController, operation: getModelPrimaryKey, message: uninitialized constant FbController
Replace
Dependencies.mechanism = :load
with:
ActiveSupport::Dependencies.mechanism = :load
I've allready changed this, but setting up the service still causes errors:
FB4:
Server error uninitialized constant FbController details not available
Rails:
INFO: unable to load source file, FbController, hopefully Rails has already loaded it.
ERROR: Exception processing request. Destination: FbController, operation: getModelPrimaryKey, message: uninitialized constant FbController
step throught this tutorial again..
know i'm getting this error:
Server returned HTTP response code: 500 for URL: http://localhost:3000/weborb
Thanks
-David
FB4: Server error uninitialized constant FbController details not available
Unfortunately I was not able to find a way to resolve the issue this weekend. After a few hours of debugging I did track it down to a method in the plugin code that took an argument for a class name and path, and I suspect this FbController is something that's a change by the Adobe team to the wizard, and is causing this extension to break. I'd blindly updated to FlexBuilder 4 release version and updated this extension code because I saw there was an update to this extension on the same day as the release of the official FlexBuilder 4 (bad idea without making sure I had installers for both of the original versions that were working). I've logged a bug with this project, and hopefully the developer is watching his bug notifications and will respond promptly.
I was hoping to get to spend more time on it, but with the work week coming up I doubt I'll be able to dig any further until next weekend. Let's hope the developer can take a look and resolve it before then!
Issue fixed and download updated.
Again, thank you for the fix, and also thank you for the wonderful plugin/extension!
I have been playing with the templates to customize to my requirements. It would be nice to have relationships queries added. For example, if I have a User domain that has many Scenario domains. It would be nice to have it generate a listByUserID for the Scenario services, etc. If you need help, let me know?
Additionally I changed the update service method to return the updated domain, this works better if you want to enable data management.
Thanks again, Kirk
What I can't figure out is how to access current_user in my services in the services/weborb folder. Even if I log in via authlogic through the rails views, I still can't access current_user in my custom weborb service.
Here is an excerpt from my "ContactService.rb":
This works, but doesn't grab contacts for current_user, it grabs contacts for all users:
class ContactService
def list
return Contact.find(:all)
end
This does not work, get an error about current_user being an unknown variable:
class ContactService
def list
return current_user.contacts.find(:all)
end
<a href="http://www.onlinemedicineinfo.com/vicodin.php">vicodin</a> |
<a href="http://www.onlinemedicineinfo.com/metoprolol.php">metoprolol</a>
http://www.gucci-zone.com gucci outlet
http://www.gucci-zone.com gucci outlet online
http://www.gucci-zone.com gucci outlet store
<a href="http://www.ovulationsymptoms.org" rel="follow">ovulation symptoms</a>
Please review comments and remove spam! These jerks are spoiling your blog.
Carly S.
<a href="http://www.nt-ice.com">www.nt-ice.com</a>
I really really liked the stuff you are talking about!
This makes sense and I will write about it at http://www.bestessayhelp.com/
http://www.onlinecoachfactoryoutlets.com coach outlet online
http://www.onlinecoachfactoryoutlets.com coach factory outlet
<a href="http://www.pricesskiphire.co.uk/">skip hire</a>
<a href="http://www.pricesskiphire.co.uk/skip-hire-prices.html" target="_blank">http://www.pricesskiphire.co.uk/skip-hire-prices.h...">skip hire prices</a>
<a href="http://www.pricesskiphire.co.uk/skip-hire-london.html" target="_blank">http://www.pricesskiphire.co.uk/skip-hire-london.h...">skip hire london</a>
Abir(<a href="http://www.wonderfilereviews.net/wonderfile-file-o...">Wonder File Organizer</a>)
http://www.nikeairmaxshoes2011.org/ nike air max 2011
http://www.nikeairmaxshoes2011.org/ air max shoes
http://www.nikeairmaxshoes2011.org/ air max 2011
Another gadget was <a title="christian louboutin pumps" href="http://www.christianlouboutineonsale.com/christian-louboutin-pumps-c-4.html" target="_blank">Christian Louboutin pumps</a> gear with in-built sling box technologies for documenting the applications for afterwards viewership. You also could retain handle of all of your preferred programming stuff from mobile units like laptops and stuff. With thischeck you can appreciate television everywhere just like everything. on this way this check facilitates wireless connectivity to all alerts in Christian Louboutin product from anywithin the present receiver through Wi-fi connection <a title="Christian Louboutin sale boot." href="http://www.christianlouboutineonsale.com/christian-louboutin-boots-c-1.html" target="_blank"> Christian Louboutin sale boot.</a>
http://implantesdentalespreciosymas.com
http://keratinaparaelcabello.com
http://alarmas-domiciliarias.blogspot.com
mulberry bags gain recognition as a end result of its multifunction.Their natural leather messenger tote within our shop for a large amount of people can be a custom bag.With perfect design and charming styles
Mulberry Cross Body Bags are utilised as being a classy style accessory.
If you are a good swimer,do you want to have a
ed hardy uk which belongs to you
http://www.vivaessays.com/write-my-paper.html
<br>Shopping to <a href="http://www.louisvuittonoutletonsales.com"><strong>Louis Vuitton Outlet stores</strong></a> is American women's habit when they in holiday,shopping to <a href="http://www.louisvuittonoutletonsales.com"><strong>Louis Vuitton Outlet stores</strong></a>,they will find <a href="http://www.louisvuittonoutletonsales.com"><strong>Louis Vuitton on sale</strong></a> there,and they bought one to relex themselves,and make them happy.That is a good way to spend their holidays.Now I will recommend a new way to buy Louis Vuitton,that is get <a href="http://www.louisvuittonoutletonsales.com"><strong>cheap Louis Vuitton handbags online</strong></a>!!<a href="http://www.louisvuittonoutletonsales.com"><strong>Louis Vuitton Outlet stores</strong></a> also have there online store,in there you can also get beautiful Louis Vuitton handbags with incredible price,and the products is not over times,such as <a href="http://www.louisvuittonoutletonsales.com/index.php?main_page=index&cPath=239"><strong>Damier" target="_blank">http://www.louisvuittonoutletonsales.com/index.php... Azur Canvas wallets</strong></a>,<a href="http://www.louisvuittonoutletonsales.com/index.php?main_page=index&cPath=241"><strong>Epi" target="_blank">http://www.louisvuittonoutletonsales.com/index.php... Leather</strong></a>,<a href="http://www.louisvuittonoutletonsales.com/index.php?main_page=index&cPath=240"><strong>Damier" target="_blank">http://www.louisvuittonoutletonsales.com/index.php... Ebene Canvas</strong></a>, so go to <a href="http://www.louisvuittonoutletonsales.com"><strong>Louis Vuitton outlet stores</strong></a> now,and enjoy it!!!<br>
Rob
<a href="http://tcmarthritisremedies.blogspot.com/2011/06/c..."> treatment for rheumatoid arthritis</a>
christian louboutin is very good,and wear so classy that we don't worry about what to wear in parties.
http://implantesdentalesprecios.blogspot.com/
http://www.abercrombieoutletonlines.org/ abercrombie & fitch outlet
http://www.abercrombieoutletonlines.org/ abercrombie and fitch outlet
http://www.abercrombieoutletonlines.org/ abercrombie outlet
http://www.ravensfansjerseys.com Baltimore Ravens Jerseys
http://www.cardinalsfansshop.com Darnell Dockett Jerseys
<a href="http://www.veterinarytechnicianguide.com/">vet tech</a>
http://www.solargaines.com/solarpanelinstallation....
<a href="http://www.secretstohomedecoratingsuccess.com/">Home Decorating</a>
<a href="http://stellarreviews.com/">free movie downloads</a>
http://viagrainindia.net/
http://www.medstorez.com/
http://pills4australia.com/
http://www.nikejerseyssale.org/ nike nfl jerseys
http://www.nikejerseyssale.org/ 2012 Pro Bowl Jerseys
http://www.nikejerseyssale.org/ Arizona Cardinals Jerseys
http://www.nikejerseyssale.org/ Atlanta Falcons Jerseys
http://www.nikejerseyssale.org/ Baltimore Ravens Jerseys
http://www.nikejerseyssale.org/ Buffalo Bills Jerseys
http://www.nikejerseyssale.org/ Carolina Panthers Jerseys
http://www.christianlouboutinoutletsonline.org/ christian louboutin outlet
http://www.christianlouboutinoutletsonline.org/ Mens Christian Louboutin Sneakers
http://www.christianlouboutinoutletsonline.org/ Christian Louboutin Sandals
http://www.franklinandmarshalloutlets.org/ Franklin & Marshall Polo T-shirts
http://www.franklinandmarshalloutlets.org/ Franklin and Marshall Short Tees
http://www.franklinandmarshalloutlets.org/ Franklin and Marshall Hoodie Sweatshirts