What is the difference? I ask because I’m just starting RoR dev, and I need to modify an application to add a new div to a page. I want to be able to render this div independently, and currently the rhtml code is part of the view of the page that will be rendered. I assume I would need to move this into a partial layout from what I have gathered so far.
Share
The view is context based, i.e. related to the particular controller#action you are hitting based on the RESTful URL being requested. The controller#action serves your request and delegates the appropriate view to be yielded back to your base-application template.
You will find
<%= yield %>in yourapplication.html.erbfor this very reason.As for your first question, Bessam is correct and you need to look at partials.