#rubyonrails - Sat 31 Mar 2007 between 06:54 and 07:00

NY Lost Funds



AnakinKainso I got it down to this...
<%= javascript_tag( image_tag(theme.bgsmall, :size=> "100x100"), "onclick="Element.setStyle('background_main', {background-image: theme.bglarge} )"" %>
oops.
I mean.
psticknewhy isn't it classroom 1-M(?) class M-M student #?
AnakinKainundefined method `merge' for #<String:0x52dfe9c>
ReinHlike Classroom has_many :students, :through => :sections; Classroom has_many :sections, :include => :students
pstickneit doesn't seem like a good DB approach
AnakinKainbut that doesn't make sense because merge, has absalutely nothing to do with it..and doesn't even exist.
ReinHBut that would eager load students *every time*
AnakinKain...anywhere in my code.
zachinglisAnakin..
look at the trace
one of the functions will use merge
pstickneAnakinKain, you are passing a string when something expects a hash. deal with it ^^
ReinHbut @classroom.students.include? @student would sure be nice
zachinglisbut first off, <%= javascript_tag( image_tag(theme.bgsmall, :size=> "100x100"), 'onclick="Element.setStyle('background_main', {background-image: theme.bglarge} )'" %>
use that code instead
i told you, ESCAPE Those quotations
ReinHyou could do @classroom.sections.students.include? @student with an extension to the has_many :sections association
psticknePalish, I'd question the DB design at this point personally ^^
zachinglisor use 's
ReinHpstickne: any improvement over this? http://pastie.caboo.se/50762
AnakinKainok, i had no idea what the word..merge meant in that shit.
PalishReinH: sticky.
ReinHPalish: hmm?
PalishThanks for your help.
pstickneReinH, I don't like the general DB layout...
ReinHPalish: two suggestions I have are 1) to try to leverage ActiveRecord whenever possible instead of writing SQL and 2) to worry about time-consuming optimizations *after* you find out if the optimization is even necessary
pstickneAnakinKain, `ri merge`
ReinHri Hash#merge
zachinglisAnakinKain: That is exactly what the trace is for, look at the parent function that is using merge
psticknezachinglis, your "define_method" is very ... fishy
zachinglispstickne: why?
beats missing_method
psticknedefine_method(:x) { "stuff in here" }
ReinHpstickne: not my layout. shrug :)
AnakinKainman just merda. the parent function along with any function that has to do with the code has nothing like the word merge....
ReinHPalish: one thing I forgot to explain is that foos.map(&:bar) is rails shorthand for foos.map{ |foo| foo.bar }
psticknezachinglis, I'm not exactly sure how that code is even running ;)

Page: 3 10 17 24 31 38 45 52 59 66 73 80 

IrcArchive

NY Lost Funds