Hello Rails lovers!
I have a few general discussions that I have yet to find terribly
active. Perhaps all of the people busy on this front are…uh…busy on
this front.
So!
Ajax-only apps.
No degration.
Yes! Forget about degradation for a moment. Not willing to? Ok,
well…this question is for those who are willing…
Imagine developing an app that is one page - all actions render partials
on this page, probably with rjs. Already done it? Great, these questions
are for you then:
- Browser pre-loading. I am interested in NOT having the user sit
around while my software loads and renders 10 results at a time, just
like a ‘normal’ webpage. Not sexy. Updating and redrawing a part of the
page is only the tip of the iceberg… I feel that it is time to be able
to make sorting through larger amounts of data much more sexier, as a
standard…
Here is my answer to this question, perhaps you have comments, or can
enlighten me with other answers.
— A Client-side pre-loading framework…Aka, on the page load we load
100 results into the browser, hide 90 of them in “display:none” divs,
then when we click on another page, no server calls are made, we just
use Element.show and hide to jump through the results. To me, loading
extraneous data on 1 sever call, saving 4 or 5 extra calls is much more
‘user-time-efficient’ than expecting the user to watch a rolly ball spin
over and over again to load a couple kb…
It seems to me that the only way Ajax is really going to make the web
sexy is if 3 out of 4 requests coming from a client are handled locally,
and the user wait time is reduced.
- Periodic “background” calls from the client update the server with
client side changes…This method seems a bit more complex, would
involve loading the page data into javascript objects, having the page
actions modify those javascript objects, and then calling the server on
a regular basis to sync…Writing messages in Gmail seems to give the
illusion of working in this way, where it saves periodic drafts of
messages without worry or concern on the user’s behalf. If the current
copy of the message is not saved, and you try and navigate away, you get
a popup asking what you want to do with the draft.
Rails seems like the ideal candidate for this kind of advancement in app
development. In the name of DRY, it would be useful to find the most
efficient paths, implement them once, and then walk away. Already it is
amazing to make a call like “sortable_element…” or “page.replace_html”
- very sexy…Dragging and dropping is amazing! But on every drag, every
drop - a server call? There must be a better way, and I am very
interested in finding/developing it… As far as I know, no larger
framework or plugin currently exists to really take applications to the
‘next level’…for example:
page.cache_and_paginate ‘div_container’, ‘hidden_div_series’, :partial
=> ‘single_result’
or
<%=droppable_element ‘add_to_favorites’, :sync => true %>
page.sync ‘add_to_favorites’,
page.sync ‘my_sortable’
page.sync :all
Ideas?
love
sudara