Skip to content

Instantly share code, notes, and snippets.

namespace :db do
task :seed => :environiment do
task :medici do
desc "Adaug medici in baza de date"
Medic.create!(:nume => "Serafinceanu", :prenume => "Cristian", :cod_parafa => "282828")
Medic.create!(:nume => "Craciun", :prenume =>"Anne-Marie", :cod_parafa =>"999")
end
end
end
link from evaluares#new
<%= link_to 'Add a paraclinic that is not on the list', new_pacient_evaluare_paraclinic_path(@pacient, @evaluare)%>
fails with
No route matches {:action=>"new", :controller=>"paraclinics", :pacient_id=>#<Pacient id: 828, nume: "Popescu", prenume: "Gheorghe", cnp: "1220702400141", adresa: nil, debut_diabet: "1977-01-01", focad: nil, created_at: "2012-09-03 19:54:04", updated_at: "2012-09-03 19:54:04">, :evaluare_id=>#<Evaluare id: nil, data: nil, diagnostice: nil, recomandari: nil, pacient_id: nil, created_at: nil, updated_at: nil>}
controller that fetches pacient
class EvaluaresController < ApplicationController
def index
@pacient = Pacient.find(params[:pacient_id])
@evaluares = @pacient.evaluares
respond_to do |format|
format.html # index.html.erb
end
end
No route matches {:action=>"show", :controller=>"evaluares", :pacient_id=>#<Evaluare id: 88, data: "2009-10-30", diagnostice: "IRC std III, dz tip 2 complicat, BCI angor de efort...", recomandari: "1.dieta cu 250hc, hiposodat cu restrictie proteica:...", pacient_id: 828, created_at: "2012-09-12 17:40:09", updated_at: "2012-09-12 17:40:09">}