Giter Site home page Giter Site logo

learnhowtoprogramiguess's Introduction

#Rebuild this site

learnhowtoprogram.com is powered by a fairly simple Rails app. Rebuild it yourself.

First, work on CRUD/L functionality for lessons. A lesson has a name and some text content. Don’t worry about videos and cheat sheets. Now, we need to get the order of the lessons in. Each lesson has a number. When you click Next lesson at the bottom of the page, it goes to the lesson with the next-highest number. Here’s the spec I wrote for this method: lesson_spec.rb describe Lesson do

context '#next' do
  it 'returns the lesson with the next-highest number than the current lesson' do
    current_lesson = Lesson.create({:name => 'lesson1', :number => 1})
    next_lesson = Lesson.create({:name => 'lesson2', :number => 2})
    current_lesson.next.should eq next_lesson
  end
end

end Also, take care of the Previous lesson link.

Then, add sections: a section has many lessons. List out sections in the table of contents, along with the lessons inside them. Make the table of contents completely expanded - don’t worry about the JavaScript that lets you expand and collapse sections. When you create a lesson, provide a drop-down list of all the sections, so that the user can choose which section it’s in. (If you didn’t get to drop-downs before, do a web search for html drop-down mdn to learn how to make them in HTML.) Next, add chapters: a chapter has many sections. Make sure that the table of contents displays the lessons in the order of their number attribute. Use a default scope and the Active Record order method. Don’t know what that means? I bet you can figure it out!

learnhowtoprogramiguess's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.