Hi,
The below code is my global layout..code I would like to include a if
statement in it.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Languages: <%= controller.action_name %></title>
<%= stylesheet_link_tag 'scaffold' %>
</head>
<body>
<p style="color: green">
<% if flash[:notice].empty? %>
<%= flash[:message] %>
<% end %>
</p>
<%= yield %>
</body>
</html>whats wrong with the if statement here..?
Thanks in advance,
Sharma
You need to use <%= %> to get output from ERb and (as others have said) you don't use puts in templates.
You're Welcome,
-Rob
Rob Biedenharn http://agileconsultingllc.com
Rob@AgileConsultingLLC.com