Skip to content

Instantly share code, notes, and snippets.

@kronosapiens
Created February 20, 2014 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kronosapiens/9125450 to your computer and use it in GitHub Desktop.
Save kronosapiens/9125450 to your computer and use it in GitHub Desktop.
Code to create the movies index.html
index.write(
<<-HTML
<!DOCTYPE html>
<html>
<head>
<title>Movies</title>
</head>
<body>
<ul>
#{Movie.all.map {|movie| "<li><a href=\"movies/#{movie.url}\">#{movie.title}</a></li>\n"}.join(" ")} </ul>
</body>
</html>
HTML
.chop
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment