Brian wrote:
> 
> 
> On May 28, 11:29 am, Jeff Schwab <j...@schwabcenter.com> wrote:
>> That's not how Rails works.  You're mostly right about the Models, but
>> the controllers are, as Phlip suggested, just "patch boards," not for
>> user input.  Sometimes a savvy user can send HTTP requests to a Rails
>> application without going through any view, but that's not the intent.
>>
> 
> 
> I'm new to both rails and MVC, so please correct me if I
> misunderstand.  But it seems that controllers DO handle user input for
> the typical web application.  A view helps a user format that input,
> but it can't receive anything.  In fact, I could just send an http
> request to a rails application before ever interacting with UI.  The
> controller is what processes this request, consulting models if
> necessary.  The view isn't involved until the application tries to
> send information back to me.

You could, but you ordinarily don't.  A user typically deals with a web 
page, entering information in (e.g.) a styled form.  The controller only 
deals with "input" in the sense of HTTP requests, and it doesn't know 
whether they come directly from some hacker, or from an XMLHttpRequest 
object in some Ajax application.  In such a case, btw, the Controller 
sends back XML directly, without going through the view; so, if we're 
going to take the stance that Controllers deal with input directly, then 
we also have to see them as providing output directly.  It makes more 
sense, IMO, to see the View as defining the UI, and the Controller as an 
implementation detail.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to