March 27, 2005
Accessifying the Ajax magic in Rails
The Ajax magic in Ruby on Rails 0.11 is nothing short of amazing. With only a few simple helper tags you can now jump on the Ajax hypewagon without writing a single line of Javascript, how cool is that?
Now it's time to add some polish to make the whole process more accessiblish. Right now our Ajax powered links and forms are nothing but dead dummy widgets without the Javascript pixie dust that powers it all.
Here are some ideas for you to tear apart:
What if we let every Ajax form and link point to a second controller action that would handle any server-side changes and redirect the client to a whole-page representation of the new state in a non-ajaxified environment?
Since a second action might lead to a duplication of controller logic, how about using the same action for both Ajax and vanilla requests? The controller would need to be able to test whether the current request was called in an Ajax context and then either render the partial for Ajax remixing or do a vanilla redirect to the whole, updated document.
Please do post your comments. This accessiblity thing is dear to my heart. Also maybe 37 Signals could be more relaxed about supporting non-mainstream browsers if we could solve this in a gentle manner.
Comments
That is exactly the approach I was suggesting, yes.
Post a comment
Thanks for signing in, . Now you can comment. (sign out)
(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)