#Sinatra: Part 2
Continue re-creating the student website as a dynamic web application using Sinatra and the Student Class you created in the Student Class DB lab.
-
Add the static assets (stylesheets, javascripts, and images) from the student static website.
-
Style the students index page
if you need assets! 003.students.flatironschool.com
In Sinatra, static files are served from the ./public directory. You can specify a different location by setting the :public_folder option:
set :public_folder, File.dirname(__FILE__) + '/static'
Note that the public directory name is not included in the URL. A file ./public/css/style.css is made available as http://example.com/css/style.css.
http://www.sinatrarb.com/intro.html#Static%20Files
-
Create a directory called 'public' in the root of the project.
-
Copy your static assets such as css, javascript, and images over to this folder.
In part one, you created an ERB template to output your listing of all the students. Now your goal is to apply the HTML markup you created to your new students layout. You should use that markup and combine it with the block you made to output all the students data. Remember that the ERB extension renders to HTML, so HTML in your .erb templates is perfectly fine.
Instead of having each students information hardcoded, you will now use Ruby and ERB in your layout to loop through each student and output the appropriate markup and information from the database.
For example, if I had an array of artists I could do something like:
<% @artists.each do |artist| %>
<h1><%= artist.name %></h1>
<% end %>