-
-
Save esteedqueen/6947239d0d160a7b499fce70a06c88e2 to your computer and use it in GitHub Desktop.
ERB and the case statement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Doesn't work | |
<p> | |
<% case @request.author_hosted %> | |
<% when "yes" %> | |
The school <b>has</b> hosted an author before. | |
<% when "no" %> | |
The school <b>has not</b> hosted an author before. | |
<% end %> | |
</p> | |
# Does | |
<p> | |
<% case @request.author_hosted | |
when "yes" %> | |
The school <b>has</b> hosted an author before. | |
<% when "no" %> | |
The school <b>has not</b> hosted an author before. | |
<% end %> | |
</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment