Showing posts with label Magic of Ajax with Ruby On Rails. Show all posts
Showing posts with label Magic of Ajax with Ruby On Rails. Show all posts

Friday, March 28, 2008

PHP Vs Ruby

Ajax: Rails and Symfony both use Scriptaculous and Prototype. CakePHP
does, but you have to download and install it separately, which, to
me, calls into question how well they're integrated.

Authentcation: CakePHP has a built-in system, but that system won't
fit all needs, so you'll end up writing custom code anyway.

Caching: CakePHP only has view caching.

Database versioning: None in CakePHP or Symfony, though Symfony has an
XML file for each db table, and, I suppose, you could svn them and
have versioning that way. Migrations in Rails are superior.

Environments: No real separation of environments (prod/dev/test) in
CakePHP.

Console: None in CakePHP. Symfony and Rails, yes. If you want to use
Rails and you think you won't use the console, you're wrong. Once you
understand the power, you'll never want to debug without it.

Testing: Little integrated testing. It produces some stubs when you
"bake" a project, but I prefer how Rails puts those stubs there when
you're creating models and controllers, right from the get-go. (More
on this below.)

Join models: None in CakePHP. Rails has HABTM and has_many :through.
All tables are models in Symfony, so that's almost the same. More
like HABTM with extra info in the table. Propel, Symfony's ORM
engine, is actually quite interesting. (Though, I prefer
ActiveRecord.)

Form validation: Good in all frameworks, but there are some extra
steps involved in dealing with invalid form data in CakePHP.

Thursday, January 31, 2008

Magic of Ajax with Ruby On Rails

Rails Implements Ajax

Rails has a simple, consistent model for how it implements Ajax operations.

Rails has a simple, consistent model for how it implements Ajax operations.

Once the browser has rendered and displayed the initial web page, different user actions cause it to display a new web page (like any traditional web app) or trigger an Ajax operation:

  1. A trigger action occurs. This could be the user clicking on a button or link, the user making changes to the data on a form or in a field, or just a periodic trigger (based on a timer).
  2. Data associated with the trigger (a field or an entire form) is sent asynchronously to an action handler on the server via XMLHttpRequest.
  3. The server-side action handler takes some action (that's why it is an action handler) based on the data, and returns an HTML fragment as its response.
  4. The client-side JavaScript (created automatically by Rails) receives the HTML fragment and uses it to update a specified part of the current page's HTML, often the content of a tag.

An Ajax request to the server can also return any arbitrary data, but I'll talk only about HTML fragments. The real beauty is how easy Rails makes it to implement all of this in your web application.


The 7 Habits of Highly Effective Web 2.0 websites

Steven Covey, author of “The 7 Habits of Highly Effective People” identified principals which also apply to modern Web 2.0 websites.

Highlights and Site Examples include:
  1. • Your customer is the boss- how your website can listen better
  2. • Start and update your website with your goals in mind
  3. • Balance user experiences with site goals
  4. • Deliver Value back to your web visitors
  5. • Be honest-examine and evaluate what doesn’t work
  6. • Web 2.0- Create an ongoing dialog and community with your customers
  7. • Sharpen your website’s saw- renewal techniques that work