You’re closer than you think to a career in tech. Our grads have launched rewarding new careers — you can too.View Our Jobs Report
So Nice’s UI is very simple – it’s a single web page displaying the name of the current song playing, the artist name and the album name. In the background there’s a rotating graphic related to the album, which they pull from Last.fm.
The assignment for this post is to break down the files in the repository to better understand how Sinatra is structured. Here they are:
so-nice/config.ru Does nothing more than require sonice.rb and run Sinatra. Has optional switches to disable controls and voting features.
so-nice/sonice.rb Sets the individual controls that appear on the page and the title, artist and album that are currently playing.
so-nice/Gemfile Tracks the gems currently used by the application. Used by Bundler, along with Gemfile.lock.
so-nice/Gemfile.lock Tracks the versions of the gems thatyou rely on to run your application. Used by Bundler, along with Gemfile.
so-nice/public The directory containing the web site.
so-nice/public/jquery.min.js Something in jQuery that I wish I understood.
so-nice/public/stylesheet.css The CSS stylesheet for all of the HTML on the page.
so-nice/views The directory that holds the code that will generate the HTML for the web site.
so-nice/views/index.haml The sole file that generates the HTML for the app.
Blog Post Author
Since we opened our doors in 2012, thousands of students have joined Flatiron School to launch new careers in tech.
Find the perfect course for you across our in-person and online programs designed to power your career change.
Connect with students and staff at meetups, lectures, and demos – on campus and online.
Have a question about our programs? Our admissions team is here to help.