Hello list,
I’m developing an application in Rails and I’m using Extjs 2 for
GUI/presentation stuff.
I’ve found some plugins and helpers that claimed to solve some of the
issues
on Extjs and Rails integration. However, high-level frameworks like
ExtJs
are better programmed using the “Proxy” Ajax-style (term coined by
Edward
Benson on his excellent “The Art Of Rails” book). In this Ajax style,
the
server is has most of business-rules implemented and the client,
implemented
in Javascript/HTML/CSS can also have some business rules but mostly
applied
to the presentation of the data. However, it’s like there are two
application, the client and the server, and the client can, in theory,
live
without the server or use another backend, something that doesn’t happen
with the “Partial” and “Puppet” styles, where compiled RJS and partials
are
sent back to the client.
The following page talks about using Extjs with Rails:
http://inside.glnetworks.de/2008/01/08/ext-js-and-rails-how-do-they-get-along/
It even provides a link to a plugin that provides a scaffold generator
and
extends ActiveRecord::Base to provide a helper method to generate
ExtJs-compatible json.
But from what I could understand, the author only views ExtJs as a cool
GUI
for CRUD views. He does mention RIAs, but I didn’t see any mention of
techniques to really develop RIAs with Extjs and Rails. His approach is
useful only if you want fancier CRUD views or eventually use some of the
ExtJS widgets in parts of your website/web app. Please, someone correct
me
if mu judgment happens to be wrong.
So, the main question is: What would be the best way to develop a RIA
with
Rails and ExtJS while still getting the most of out of Rails (RESTful
design, testing, excellent maintabilty) and also from ExtJS
(desktop-like
experience, no page reloads)?
My opinion is: Unless ExtJs gets completely abstracted in Ruby/Rails
(something that Ext GWT did for Java/GWT), if you really want to benefit
from ExtJs for Rich Internet Applications, you will have to shift your
mindset and don’t treat Rails as the central toolbox/ “cockpit” for the
application. You will have to get your hands dirty and write JavaScript
in
separate JS and HTML files. Rails would then serve the necessary data
via
JSON. I don’t see also any use for Rails views here.
Please, share your opinions and experiences!
Thanks,
Marcelo.