Oct 26 2006

Adobe Digital Editions – Nice example of an RIA

Tag: FlexDerek Wischusen @ 12:53 am

A bit off topic for this blog, but I encourage everyone to check out the Digital Editons page on Adobe Labs: http://labs.adobe.com/technologies/digitaleditions/

I think this is a nice example of an Apollo like application, and it will probably be one of the most pervasive Flex apps in the near future, so it’s worth a quick look.


Oct 26 2006

Need to do full text search in your application? Get a Ferret.

Tag: Flex and RailsDerek Wischusen @ 12:23 am

 Ferret Logo

Ferret is a Ruby implementation of the Apache Lucene text search engine, and like most things in Ruby on Rails using it in your application is extremely easy.  Here is all you need to do:

   1.  Open up a command line and install Ferret:

 gem install ferret

 

   2.  Then install the acts_as_ferret plugin in your Rails application folder:

ruby script/plugin install svn://projects.jkraemer.net/acts_as_ferret/tags/stable/acts_as_ferret

 

   3.  Crack open the model class that wraps the table that you want to search and add:

acts_as_ferret

For example, if you wanted to be able to search the bugs in an issue tracker you could add:

class Bug < ActiveRecord::Base
    acts_as_ferret :fields => [ 'description']
end

Where :fields specifies which fields you want to index.  If you do not include this all of the fields will be indexed.

 

   4.  then add something like the following to your controller class:

def search
    @bugs= Bug.find_by_contents(params[:query])
    render(:xml => @bugs.to_xml)
end

  

   5.  lastly, you can call this method from Flex using an HTTPService.

For example, the following would return all of the bugs that contain the word ‘error’ in the description field:

searchBugs.send({query:"error"});


Oct 15 2006

Flex and RoR on Flex Developer Center

Tag: Flex and RailsDerek Wischusen @ 2:33 am

Ruby on Rails has made its first appearance on the Flex Developers Center.  To help spread the word about both Flex and Rails, I recently put together an article for the Developer Center that covers the basics of integrating Flex with Rails.  You can check it out here: http://www.adobe.com/devnet/flex/articles/flex2_rails.html

The article basically describe how to develop the issue tracker app that I put together for the Flex RoR SDK.

If you have a chance, take a look and let me know if you find any glaring errors.

Special thanks to Mike Potter and Amy X. Wong (the editor at the Developer Center)  for their help in putting this together.