Displaying 7 results from an estimated 7 matches for "teacher_id".
2013 Jun 22
4
ActiveRecord::Base.transaction - SystemStackError - stack level too deep:
...ecord::Base.transaction do
# Create Resource
@resource = Resource.new
@resource.resource_name = params[:resource][:resource_name]
@resource.resource_type = params[:resource][:resource_type]
@resource.source_id = params[:resource][:source_id]
@resource.teacher_id = teacher.id
@resource.save
# Create Resource Document
@resource_document = ResourceDocument.new
@resource_document.resource_document = params[:resource_document][:resource_document]
@resource_document.resource_id = @resource.id
@resource_document.sa...
2005 Apr 20
2
Has And Belongs To Many Validations
Here is the schema that I am working with:
courses -> courses_teachers <- teachers
I want to ensure that a teacher is not assigned the same course more
than once. In other words, if I''m in the courses_teachers table as
teaching Spanish 101, if someone tries to add that same teacher/course
combination to the table again, it will not be allowed.
I thought I could use something
2008 Feb 11
0
Problem in passing params
Hi,
I have a controller called students_controller.rb
From a view file i am calling the index method by the URL like,
students_path(:format => :json)
I have no problem in that. But i want to pass the teacher_id as the
parameter. Like,
students_path(:format => :json, :teacher_id => 5)
The problem here is, the parameter is passing as,
"amp;teacher_id" => "5"
I want to get the correct params. Is there any way to pass correctly?
Thanks in advance.
- Karthik.
--
Posted via...
2007 Dec 04
5
when to save, session reflect saves?
I am trying to clean up unnecessary lines (even as I hack my way forward
adding more garbage)
I have two questions on lines I have trying to keep the database and
session info reflecting changes:
def associate_pupil_to_teacher
@teacher = session[:teacher]
@pupil = Pupil.find(params[:id])
@teacher.pupils << @pupil
@teacher.save #Q1
session[:teacher] = @teacher #Q2
end
#Q1 do i
2014 Feb 05
0
Solr Search with one to many associations
..., stored => true do
slots.map(&:start_time)
end
string :start_time, multiple => true, stored => true do
slots.map(&:end_time)
end
end
end
class Slot < ActiveRecord::Base
attr_accessible - day, start_time, end_time teacher_id
belongs_to :teacher
end
The possible values for day attribute is slot are "Sunday", "Monday",
"Tuesday", etc
and start and end time would be "2:00pm", "6:00pm", etc in the database
How would I perform solr search query for the teachers w...
2007 Feb 28
8
Export/save csv-file to desktop of user?
Hi,
looking for something that simple, but can''t find it. I got:
outfile = File.open(''teams.txt'', ''wb'')
CSV::Writer.generate(outfile) do |csv|
for team in @teams
csv << [team.id, team.name]
end
end
outfile.close
send_file "teams.txt", :filename => "teams.txt",:disposition =>
2009 Feb 27
3
Making tapply code more efficient
Previously, I posed the question pasted down below to the list and
received some very helpful responses. While the code suggestions
provided in response indeed work, they seem to only work with *very*
small data sets and so I wanted to follow up and see if anyone had ideas
for better efficiency. I was quite embarrased on this as our SAS
programmers cranked out programs that did this in the blink