This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GradesController < ApplicationController | |
#load_and_authorize_resource | |
def aluno | |
@aluno =Aluno.find(current_user.associable_id) | |
@pessoa = Pessoa.find(@aluno.pessoa_id) | |
@aluno_diario = AlunoDiario.where(:aluno_id => @aluno.id).to_a | |
@aluno_diario.each{|alunod| | |
@diario = Diario.where(:id => alunod.diario_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
activesupport (3.0.0) lib/active_support/inflector/methods.rb:113:in `constantize' | |
activesupport (3.0.0) lib/active_support/inflector/methods.rb:112:in `each' | |
activesupport (3.0.0) lib/active_support/inflector/methods.rb:112:in `constantize' | |
activesupport (3.0.0) lib/active_support/core_ext/string/inflections.rb:43:in `constantize' | |
cancan (1.4.0) lib/cancan/controller_resource.rb:102:in `resource_class' | |
cancan (1.4.0) lib/cancan/controller_resource.rb:109:in `resource_class_with_parent' | |
cancan (1.4.0) lib/cancan/controller_resource.rb:37:in `authorize_resource' | |
cancan (1.4.0) lib/cancan/controller_resource.rb:25:in `load_and_authorize_resource' | |
cancan (1.4.0) lib/cancan/controller_resource.rb:9:in `send' | |
cancan (1.4.0) lib/cancan/controller_resource.rb:9:in `_callback_before_47' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Webgrades::Application.routes.draw do | |
devise_for :users | |
devise_scope :user do | |
get '/login' => 'devise/sessions#new' | |
get '/logout' => 'devise/sessions#destroy' | |
end | |
resources :user, :controller => "user" | |
#match 'inicio', :controller => 'user', :action => 'index' | |
match 'grades/aluno' => 'grades#aluno' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NameError in GradesController#aluno | |
uninitialized constant Grade | |
Rails.root: /home/dener/rails_projects/webgrades | |
Application Trace | Framework Trace | Full Trace | |
activesupport (3.0.0) lib/active_support/inflector/methods.rb:113:in `constantize' | |
activesupport (3.0.0) lib/active_support/inflector/methods.rb:112:in `each' | |
activesupport (3.0.0) lib/active_support/inflector/methods.rb:112:in `constantize' | |
activesupport (3.0.0) lib/active_support/core_ext/string/inflections.rb:43:in `constantize' | |
cancan (1.4.0) lib/cancan/controller_resource.rb:102:in `resource_class' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GradesController < ApplicationController | |
#load_and_authorize_resource | |
def aluno | |
@aluno =Aluno.find(current_user.id) | |
@aluno_diario = AlunoDiario.find(:aluno_id == aluno.id) | |
#@curso = Curso.all | |
#@disciplina = Disciplina.all | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SystemStackError in GradesController#aluno | |
stack level too deep | |
Rails.root: /home/dener/rails_projects/webgrades | |
Application Trace | Framework Trace | Full Trace | |
activerecord (3.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:234:in `current_connection_id' | |
activerecord (3.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:96:in `connection' | |
activerecord (3.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:318:in `retrieve_connection' | |
activerecord (3.0.0) lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in `retrieve_connection' | |
activerecord (3.0.0) lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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).to_a | |
@diario = [] | |
# @aluno_diario = AlunoDiario.all(:joins => 'SELECT * FROM aluno_diarios diarios LEFT OUTER JOIN disciplinas ON disciplinas.id = diarios.disciplina_id WHERE diarios.id = aluno_diarios.diario_id and aluno_id = 2') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@topic = Topic.new(params[:topic]) | |
respond_to do |format| | |
if @topic.save | |
format.html { redirect_to(@topic, :notice => 'Topic was successfully created.') } | |
format.xml { render :xml => @topic, :status => :created, :location => @topic } | |
else | |
format.html { render :action => "new" } | |
format.xml { render :xml => @topic.errors, :status => :unprocessable_entity } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@post = Post.new(params[:post]) | |
respond_to do |format| | |
if @post.save | |
format.html { redirect_to(@post, :notice => 'Post was successfully created.') } | |
format.xml { render :xml => @post, :status => :created, :location => @post } | |
else | |
format.html { render :action => "new" } | |
format.xml { render :xml => @post.errors, :status => :unprocessable_entity } |
OlderNewer