Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Ruby on Rails 5 Basics Handling Requests Handling Requests

Muhammad sharifi
Muhammad sharifi
4,454 Points

anyone can help

The controller receives the request, loads the requested data via the ............, and then inserts that data into the .................... in order to render a response.

3 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi, Muhammad sharifi! The request is sent to the controller which then pulls in the data from the model and sends that data off to the view for displaying :smiley:

Your controller is a bit like a guy directing traffic back and forth between the model (which holds the data) and the view (which displays the data). The controller is the middle man here. On either side of the controller is the model and the view.

Hope this helps! :sparkles:

Muhammad sharifi
Muhammad sharifi
4,454 Points

Thanks, Jennifer Nordell for the reply it's the best answer I have found it right after submitting a help

The controller receives the request, loads the requested data via the MODEL, and then inserts that data into the VIEW in order to render a response.

Just it is easier to remember with mnemonics MVC (Model View Controller)