To start create 2 local databases, one called 'chitter-dms' and the other 'chitter-dms-test'
createdb chitter-dms
createdb chitter-dms-test
Then, to create and populate the tables run the following:
psql -h 127.0.0.1 chitter-dms < spec/create_tables.sql
psql -h 127.0.0.1 chitter-dms < spec/seeds.sql
psql -h 127.0.0.1 chitter-dms-test < spec/create_tables.sql
psql -h 127.0.0.1 chitter-dms-test < spec/seeds.sql
Flash messages will dispay error/success messages dynamically dependant on the error it encounters and disply them at the top of the page.
require in gemfile and update
gem 'sinatra-flash'
add this line in the configure block of your application controller
register Sinatra::Flash
<% flash.each do |type, message| %>
<div data-alert class="flash <%= type %> alert-box radius">
<%= message %>
<a href="" class="close">×</a>
</div>
flash[:success] = "You have successfully logged in."
the 'flash' variable acts like a hash with key value pairs and will display the relevant message/s.