git clone https://github.com/stungeye/Pre-Exam-Test-Repo.git
cd Pre-Exam-Test-Repo
bundle install
rails s
When you load up localhost:3000 you should see four ghosts of different colours.
The ghost CSS (found here) depends on the names of the ghosts. Therefore adding ghosts with new names will break the display. The colour property was added to address this but is currently unused.
The ghost partial app/views/ghosts/_ghost.html.erb
:
<div class="ghost <%= ghost.name.downcase %>"> <!-- Ghost colour set using downcased name as class. -->
<div class="eyes">
<div class="eye leftEye"><div class="iris"></div></div>
<div class="eye rightEye"><div class="iris"></div></div>
</div>
<div class="ghostTail"></div>
</div>
<div>
<h3><%= ghost.name %></h3>
<p>Nickname: <%= ghost.nickname %></p>
<p>Favourite Thing: <%= ghost.favourite_thing %></p>
<p>
<%= link_to 'Edit', edit_ghost_path(ghost) %> -
<%= link_to 'Destroy', ghost, method: :delete, data: { confirm: 'Are you sure?' } %>
</p>
</div>
<hr>
ActiveRecord::Schema.define(version: 20140425201401) do
create_table "ghosts", force: true do |t|
t.string "name"
t.string "nickname"
t.string "favourite_thing"
t.datetime "created_at"
t.datetime "updated_at"
t.string "colour" # Currently unused. CSS colours derived from name property.
end
end
This is free and unencumbered software released into the public domain. See: unlicense.org