#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 12 13 
Top Prev 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 Next

#rubyonrails

<tpope> you can either construct your option list to reflect that
<tpope> or monkey patch select
<has_many_questio> ok, yeah. i think that's it
<scrooloose> you could use options_from_collection_for_select and just tack on a "select one" option with no value attribute
<has_many_questio> chuff, dont get deep on me now
<tpope> the reason I say "monkey patch" rather than "new helper" is that this is a stylistic choice
<has_many_questio> i could drop my coding and philosophize for hours..
<tpope> you want your blank option to have a label
<tpope> :include_blank => true really, really ought to be the default
<tpope> who in their right minds trusts users to change the default?
<has_many_questio> i agree with it having to be the default..
<has_many_questio> esp with all this ajax observ field stuff
<has_many_questio> it's initial load lands on a value and makes the user confused if that value is the one they want to choose, i'm sure u saw that..
<matram> Does anyone know of a way to take a string of RJS and render it into a string of Javascript? I want to store the translated Javascript for later use.
<halorgium> has_many_questio: use [Model.new + @models] as the array for collection_select
<tpope> that's not going to be nested right
<tpope> is it?
<tpope> or does it get flattened?
<halorgium> err
<tpope> [Model.new]+@models
<halorgium> ^^ that is what my brain said
<has_many_questio> :P
<tpope> it's still a lot of trouble
<tpope> for something any user interface designer will tell you is mandatory
<halorgium> @models.shift(Model.new) in the controller ?
<socalledchange> does counter_cache work for polymorphic models ?
<socalledchange> belongs_to :item, :polymorphic => :true, :counter_cache => true
<tpope> there is already :include_blank anyways
<halorgium> yes, but what i sometimes do is the following, [Model.new(:display => 'This')] + @models
<tpope> that's just so ... impure, on so many levels
<halorgium> yip :(
<halorgium> pollution of view ftl :/
<tpope> that's the downside of having mr. "don't take criticism" for your leader
<halorgium> s/of view //
<mileszs13> Man can he dish it out though.
<Zycon> how do you get the current version of rake db?
<aniero> matram: render_to_string
<Zycon> the database version that is
<matram> aniero: but how would I use render_to_string in conjunction with a string of rjs? I am not going to have a seperate rjs file to work with, the user will be typing rjs into a textbox.
<aniero> wha....
<matram> aniero: yeah it sounds weird but it is what I want to do
<aniero> you're gonna have to do some crazy hackery then, and that's going to be a pretty nasty security hole to boot
<matram> basically I need a way to eval RJS into javascript in a controller
<matram> in a string
<Zycon> is there anyway to run a single migration file again?
<Zycon> i.e. lets say we are at verion 10 and i rename a column in version 004_whatever... can i just run the drop and create for that migration?
<aniero> render_to_string :update do eval(@horrible_awful_user_input) end
<aniero> something along those lines
<matram> aniero: hmm that might work
<aniero> also, i strongly warn you that it's an enormous gaping security hole

Previous Page  Next Page

Search ircarchive.info