socialforge/app/controllers/syllabuses_controller.rb

24 lines
444 B
Ruby

class SyllabusesController < ApplicationController
before_filter :is_logged, :only => [:index, :show]
before_filter :find_syllabus, :only => [:show]
def index
user = User.current
@syllabuses = user.syllabuses
end
def show
@courses = @syllabus.courses
end
private
def find_syllabus
@syllabus = Syllabus.find params[:id]
end
def is_logged
redirect_to signin_path unless User.current.logged?
end
end