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
dener@dener-VGN-NW210AE:~/rails$ rvm requirements | |
Requirements for Linux ( DISTRIB_ID=Ubuntu | |
DISTRIB_RELEASE=12.04 | |
DISTRIB_CODENAME=precise | |
DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS" ) | |
NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X) | |
This is the *original* / standard Ruby Language Interpreter | |
'ree' represents Ruby Enterprise Edition |
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
dener@dener-VGN-NW210AE:~/rails$ rails new teste | |
create | |
create README.rdoc | |
create Rakefile | |
create config.ru | |
create .gitignore | |
create Gemfile | |
create app | |
create app/assets/images/rails.png | |
create app/assets/javascripts/application.js |
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
#include <stdio.h> | |
#include <stdlib.h> | |
struct item_agenda | |
{ | |
char *nome; | |
int idade; | |
char sexo; | |
float ira; | |
char fone[10]; |
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 } |
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
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
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
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 | |
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
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' |