Permalink
Browse files

Course show template tweaks

  • Loading branch information...
aslamnd committed Feb 16, 2012
1 parent 9dba80e commit 5789f07fdec0ee6e01a11a84ef9a879cdbf28926
@@ -1,2 +1,5 @@
module CoursesHelper
+ def company_class
+ @course.company.name.parameterize if @course.company
+ end
end
View
@@ -15,4 +15,8 @@ class Author < ActiveRecord::Base
validates :name, presence: true
+ def to_s
+ name
+ end
+
end
View
@@ -15,4 +15,8 @@ class Company < ActiveRecord::Base
validates :name, presence: true
+ def to_s
+ name
+ end
+
end
@@ -1,4 +1,14 @@
%h2= @course.title
+%p.author= "by #{@course.author}"
+
+%p
+ = "Difficulty: #{@course.difficulty_name}"
+ |
+ = "Duration: #{@course.duration}"
+
+%p= @course.description
+
+%p{ class: company_class }= @course.company
= link_to "Edit Course", edit_course_path(@course), class: "btn"
= link_to "Delete Course", @course, method: :delete, confirm: "Are you sure to delete this course?", class: "btn btn-danger"
@@ -30,4 +30,8 @@ Feature: Admin creates a course
Then I should see "Course has been created."
And I should be on the course page for "CSS Essentials Training"
And I should see "CSS Essentials Training"
-
+ And I should see "by Joe Marani" within ".author"
+ And I should see "This course is super awesome"
+ And I should see "Lynda.com" within ".lynda-com"
+ And I should see "Difficulty: Beginner"
+ And I should see "Duration: 3h 30m"

0 comments on commit 5789f07

Please sign in to comment.