Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. I recall that I once found that rails wasn't displaying HTML and it was a security feature.
  2.  
  3. For some reason though I find that now I can't get that situation where HTML doesn't display
  4.  
  5. So
  6.  
  7. This is my controller
  8.  
  9. > class AbcController < ApplicationController
  10. > def def
  11. > @faf="<a href=\"a/b/c.html\">aaa</a>"
  12. > end
  13. > end
  14.  
  15. This is my view
  16.  
  17. > <h1>Abc#def</h1>
  18. > <% a="<>" %>
  19. > <%= a %><br>
  20. > <% puts a %>
  21. > <% a="<a href=\"asdf/wer\">rrrrr</a>" %>
  22. > <%= a %><br>
  23. > <% @b="<a href=\"asdf/wer\">rrrrr</a>" %>
  24. > <%= @b %><br>
  25. > zzzzz<br>
  26. > <%= @faf %>
  27.  
  28. And the output is
  29.  
  30. > Abc#def
  31. > <>
  32. > <a href="asdf/wer">rrrrr</a>
  33. > <a href="asdf/wer">rrrrr</a>
  34. > zzzzz
  35. > <a href="a/b/c.html">aaa</a>
  36.  
  37. Every single hyperlink is displayed!
  38.  
  39. Why is that?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement