#rubyonrails - Sun 4 Mar 2007 between 20:38 and 21:22

NY Lost Funds



carterparksincluding capistrano
eck they're pricy though
256mb memory, 10gb storage, 1000gb transfer = $75/month
eventualbuddhaazta: on questions
aztaeventualbuddha: so I add an answer_id to questions, and question_id on answers?
coder2000azta: no
just an answer_id to questions
aztacoder2000: I'm wanting to also say Question has_one :correct_answer, :class_name => "Answer"
Rodrig0do dreamhost rails solution is one of the worst?
coder2000yes it is
azta: yes, it is still the answer_id on question
unless you get errors
it might actually be the other way around
but its only on one table
eventualbuddhaazta: you need question_id on answers, and correct_answer_id on questions
aztaeventualbuddha: ok, thanks
eventualbuddhaan alternative (and perhaps better) solution is to use a boolean field on answers (e.g. t.column :correct, :boolean)
aztaeventualbuddha: true, I'm just playing around though, trying to work out how the associations worked :)
christophe971aaaar
dnitecoder2000, i used it for a short period of time. seemed a little too 'closed' to me. i dunno. i found slicehost thou and love it.
christophe971if i call a method of my model (which contain an errors.add) from my controller, why does it don't add the error ?
dasil003how do you test multipart forms... i have a sample file I want to use and I made a 'test/files' directory where it's stored. How do I put that in the post request in functional testing?
aztaeventualbuddha: http://pastie.caboo.se/44692
this doesn't work
eventualbuddhaazta: like i said, you may have to specify the fk explicitly, like so: has_one :correct_answer, :class_name => 'Answer', :foreign_key => 'correct_answer_id'
aztathe correct_answer_id never gets anything put in it. I can say q = Question.create, then q.correct_answer = Answer.create.. looks fine, works in console, q.correct_answer shows the answer, but it's not saved
eventualbuddha: then it looks for correct_answer_id in answers
eventualbuddhaazta: oh right. belongs_to, not has_one
aztaright, Q hm :answers, A bt :q
omninerdis there anything in Rails that will make the decision to use "a" vs. "an"?
eventualbuddhaazta: no, also Q bt :ca
omninerd: i don't think so, but if there is it'd be in inflector and/or text_helper
omninerdok, thanks
aztaeventualbuddha: class Question < ActiveRecord::Base \n has_one :correct_answer, :class_name => "Answer" \n belongs_to :correct_answer, :class_name => "Answer", :foreign_key => "correct_answer_id" end ?
eventualbuddhaazta: omit the whole has_one line
aztaah
thanks eventualbuddha. Makes more sense now.
"A question belongs to a correct answer". That really doesn't read very nicely :)
thats why I was trying to shoehorn "A question has one correct answer" into rails
I guess I would have to create a correct_answers to make it read nice. Or use STI to have an answers/correct_answers ?

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 100 107 

IrcArchive

NY Lost Funds