Read my latest article: 8 things I look for in a Ruby on Rails app (posted Thu, 06 Jul 2017 16:59:00 GMT)

Does AJAX break the MVC pattern?

Posted by Sat, 18 Jun 2005 22:28:00 GMT

A friend asked me earlier after he read some background on MVC... “According to the MVC pattern, a view should never know anything about the users input.”

He was reading this PDF.

Conversely, a view should never know about user input, such as mouse operations and keystrokes.

I can see his point, but not quite sure that with javascript, that this violates the MVC rule. Javascript always seems to be an exception with web development. (does it become its own controller?)

Thoughts on how to respond to him with a good answer?

It’s obvious that we use AJAX with controllers, but what about on a simple Toggle.display() ?

Get help with your Rails project

comments powered by Disqus