Links | ? |
Part 3 / 3 : The ViewsKeaton Mon Sep 13 21:06:00 SGT 2004 For most part, Rails can already display whatever is required from the Controller. It has the default CRUD pages as neat templates (this site uses the default template stylesheet). However, other than per-object https://sfera-permanenta.ru/.. our forum application has a more special 'show' function that shows not only the Post object. Without much ado, the following is the crucial snippet of the show.rhtml : <%= @post.send("subject") %><%= "" if @post.send("email") and @post.send("email") != "" %> <%= @post.send("author") %> <%= "| url" if @post.send("url") and @post.send("url") != "" %> <%= @post.send("message") %> <% if @comments.length > 0 %> <% for entry in @comments %> <% end %>
<% end %> |