/ Published in: Ruby
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
in my app/views/layout/posts.html.erb <title><%= yield :title %>:: my fisrt rails blog :)</title> in my app/views/posts/index.html.erb <% content_for :title do %> <%= controller.action_name %> <% end %> and my _post partial <% content_for :title do %> <%= post.title %> <% end %>