The view is based on context, that is, associated with a specific controller action # that you click, based on the requested RESTful URL. The controller action # serves your request and delegates the appropriate view to return to the base application template.
You will find <%= yield %> in your application.html.erb for this very reason.
As for your first question, Bessam is correct, and you need to look at partial ones.
source share