#apache #archlinux #asterisk #centos #debian #gentoo #haskell #kde #kubuntu #lisp #math #mysql #perl #python #ruby-lang #rubyonrails #suse #ubuntu #vim #wikipedia 0 1 2 3 4 5 6 7 8 9 10 11 
Top Prev 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 Next

#rubyonrails

<tpope> all this time I've been reading your nick as halgorium
<halorgium> lol
<tpope> like they named an element after the creator of the internet
<nasr100> your example was better so i went with it
<nasr100> anyways
<nasr100> so any solution?
<halorgium> nasr100: pastie your whole routes.rb
<wangslanger> aside question: i'm doing a has_one with my own conditions
<halorgium> and also, the directory listing of #{RAILS_ROOT}/public
<nasr100> map.connect ':controller/:action/:id'
<iratik> I think i may have been at work too long - this looks so simple - but i can't even get it to follow the raise! http://pastie.caboo.se/41817
<nasr100> that's my default
<wangslanger> is there any way to reference the model calling the has_one?
<wangslanger> sorry if that's not very clear, example should hopefully be more clear
<tpope> nasr100: pastie not paste
<wangslanger> imagine we have a foo and a bar model, both of which have a color and a weight
<halorgium> nasr100: err, that isn't the default route!
<iratik> I don't see where it is expecting an Integer
<halorgium> default route is map.connect '', :controller => 'foo'
<wangslanger> each foo has one bar associated with it
<wangslanger> i'd like them to reference on both weight and color, rather than bar_id
<tpope> iratik: I can't tell from that alone. but setting all those variables to the same [] is very unlikely to do what you want
<wangslanger> so something like :conditions => "weight=thiscolumn.weight and color=thiscolumn.color"
<wangslanger> it'
<wangslanger> it's not as easy as :conditions => ["weight=?",weight], is it?
<iratik> tpope! - i'm so lost -- i thought *args would come across as a hash
<iratik> if i passed it a hash
<iratik> *hash
<tpope> it won't
<halorgium> iratik: the hash will be in the last element of that array
<tpope> but that's different than what I'm talking about
<tpope> wangslanger: thiscolumn.weight doesn't make sense
<tpope> think about it
<tpope> first_models.weight = second_models.weight maybe?
<iratik> alright - it
<iratik> i had to change it to this to get it to work
<dagbrown> or join on weight?
<iratik> http://pastie.caboo.se/41818
<wangslanger> dagbrown:i keep thinking there's a more "rails-y" solution, but i'm still pretty new to RoR
<tpope> iratik: you definitely, undoubtedly, indubitably, certainly, unequivocally do not want that
<iratik> why?
<tpope> def self.look_until(args)
<iratik> i just wanted to pass the params from the form right into this class without having any lengthy explicit specification of specific parameters being sent
<tpope> Whatever.look_until('origin' => 42)
<tpope> that's how you use named parameters
<nasr100> what's pastie mean?
<tpope> it means read the topic
<iratik> Isn't that the same as Whatever.look_until(*{'origin'=>42})
<wangslanger> pastie means really sweet, from what i see :D
<tpope> NO

Previous Page  Next Page

Search ircarchive.info