#rubyonrails - Mon 9 Apr 2007 between 04:22 and 04:38

NY Lost Funds



aroonisqs: hmm i was thinking the latter was more pure
sqs: cuz controllers typically dont care about view or view's helpers right?
sqsarooni: yeah, but you're just passing through HTML here, you're just proxying
oomwrtuok, i know i need a has_and_belongs_to_many somewhere in this, where does it go? Book has_many BookCourses has_one CoursePrefix
if that makes sense
sqsoomwrtu: you mean where do you put the has_and_belongs_to_many declaration?
aroonisqs: hmm if i do it in separate view i need to turn off layout... so must i do: render :template => 'preview', :layout => false
oomwrtusqs: yes
sqsarooni: yeah
oomwrtu: you put them in your model files, in this case book.rb
oomwrtuok, in the Book model, and it would be has_and_belongs_to_many :course_prefixes ?
sqs: or has_and_belongs_to_many :book_courses ?
sqsoomwrtu: depends on the real-life situation you're trying to describe. does a book have and belong to make book courses? course prefixes?
oomwrtusqs: hmm, ok, each Book has_many BookCourses and each BookCourse has_one CoursePrefix
sqs: maybe i had the relations right but i'm wondering how to get to CoursePrefixes
sqswhat's a bookcourse?
and what's a courseprefix?
zilly6sqs you've been very helpful, anyone you could tell me if there's a way to grab the name of a javascript variable?
anyway*
sqszilly6: what do you mean?
oomwrtusqs: i'll pastie my db as it is now
pastie
zilly6sqs like var items;
i want to have name = 'items'
sqszilly6: still not sure what you're trying to do...i would say in almost every case that you need the NAME (not value) of a variable, you're doing something wrong
aroonisqs: hmm looks like @doc.body doesnt work in my version of hpricot NoMethodError: undefined method `body' for #<Hpricot::Doc:0xb6f031cc>
zilly6well i'm trying to think of how to take an array like var items and return this string 'items[]=1&items[]=6' (url encoded of course)
sqsarooni: can you give me the link to that code again? lemme check
aroonisqs: http://pastebin.ca/430689
zilly6actually, since i was doing parameters{data:{items:{1,2,3}}} i guess i don't need the var name
sqszilly6: oh, ok, i dont think you can determine the variable name in that case, you will have to hardcode it or pass the name as another argument to your function
zilly6no worries
thanks
i appreciate your help
aroonisqs: i think syntax now might be (doc/"#elementID").to_html
sqsarooni: oh, post.body is the html - post refers to a model in the app it was written for, and its body attribute is HTML
aroonioh i'm so silly
i thought it was a shortcut for selecting the doc's body tag :P
pastiehttp://pastie.caboo.se/52493 by oomwrtu.
oomwrtusqs: ^

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 100 107 114 121 128 135 142 149 156 

IrcArchive

NY Lost Funds