Skip to content

Instantly share code, notes, and snippets.

@dennermiranda
Created November 8, 2010 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dennermiranda/668131 to your computer and use it in GitHub Desktop.
Save dennermiranda/668131 to your computer and use it in GitHub Desktop.
class GradesController < ApplicationController
#load_and_authorize_resource
before_filter :authenticate_user!
def aluno
@aluno =Aluno.find(current_user.associable_id)
@pessoa = Pessoa.find(@aluno.pessoa_id)
@aluno_diario = AlunoDiario.where(:aluno_id => @aluno.id).includes(:diario => [:curso, :disciplina])
end
def professor
@professor = Servidore.find(current_user.associable_id)
@diarios = Diario.where(:professor_id => @professor.id).includes(:curso, :disciplina)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment