Skip to content

Commit 9f63fa8

Browse files
committed
Updated lessons gem.
Still need to worry about images.
1 parent 4348fef commit 9f63fa8

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ GEM
9494
ffi (1.0.11)
9595
gherkin (2.7.2)
9696
json (>= 1.4.6)
97-
hackety_hack-lessons (1.0.1)
97+
hackety_hack-lessons (1.0.3)
9898
metadown
9999
haml (3.1.4)
100100
haml-rails (0.3.4)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
class LessonsController < ApplicationController
22
def index
3-
@lessons = HacketyHack::Lessons.titles
3+
@lessons = HacketyHack::Lessons.all.collect{|lesson| [lesson.metadata["title"], lesson.metadata["slug"]]}
44
end
55

66
def show
7-
@lesson = HacketyHack::Lessons.find_by_title(params[:id])
7+
@lesson = HacketyHack::Lessons.find_by_slug(params[:id])
88
end
99
end

app/views/lessons/index.html.haml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
%p Want to learn programming? Here are some lessons that we've put online.
44

55
%ul
6-
- @lessons.each do |title|
7-
%li= link_to title, lesson_path(title)
6+
- @lessons.each do |title, slug|
7+
%li= link_to title, lesson_path(slug)
88

99

0 commit comments

Comments
 (0)