I have a partial in Rails.
View:
<%= render :partial => "partial" %>
Partial:
<% if no_entries %>
<h1>No entries</h1>
<% return %>
<% end %>
<!-- Display entries -->
When I run this partial with an error, the output is blank. How can I make it display the <h1>
?
NOTE: In my actual code, I want to return multiple lines and I am trying to avoid an if else end
with a thousand lines in between the else and end.
Thanks!
Error!
<% end %>` – spullen Jul 01 '13 at 15:40` tag. Where are you defining `error`? Also, try putting `
– Huy Jul 01 '13 at 15:52Error!
` outside the if statement to see if you are calling the partial correctly.