#rubyonrails - Sun 4 Mar 2007 between 23:29 and 23:46

NY Lost Funds



_thom_isn't this a fairly common thing to want from a selection list in RoR?
eventualbuddha_3DStudio: there's nothing for that built in to the language
_thom_looking at the HTML generated I can see that the IDs are going in there properly
_3DStudioeventualbuddha: I seem to remember a long time ago using some language construct or maybe rails helper that let me loop through my collections but also output something else if there was nothing in the collection... without have to check @collection.size explicitly.. any idea what that might have been?
eventualbuddha_3DStudio: there *might* be a rails thing for it, but i don't think so. to test a collection i always use @collection.empty? rather than testing the size
_3DStudioeventualbuddha: yeah I guess that looks a bit nicer
chapel_thom_: hmm when you have it commented out it works but not when you have it uncommented?
_thom_: Im still learning so im no expert
but one thing i know
<%= blah %> is for showing content
<% blah %> is for executing without showing
_thom_actually I relooked at the HTML and with that line commented out I'm not getting the default choice at the beginning of the list
chapelPaymentType line should be in <% %>
and the :promt is what shows in the drop down box right?
bah
prompt
_thom_it's inside of a <%= block. why
chapelhmm
not sure if i can help
djwonkwhen doing functional testing, it is [ :impossible, :possible_but_discouraged, :ok] to do: << assert_redirected_to :controller => 'different_controller' action => 'login' >> (i.e. test redirection to another controller)
nwonknu-dunno
djwonkor should I be using integration testing for this (and in all cases where more than one controller is involved)
ReinHdjwonk: yes, that's ifne
fine even
actiondjwonk cannot parse ReinH's answer. expecting Symbol
djwonkcannot parse ReinH's answer. expecting Symbol
thanks ReinH
ReinH: ok, if that works, then great, I've got an error for ya... :)
ReinHhmm, maybe you can't assert redirected to another controller
sec
djwonk: no, should be able to do assert_redirected_to :controller => 'foo'
djwonkReinH: right, i'm preparing a pastie now...
action_thom_ hopes he can get in line to ask ReinH about his issue at http://pastie.caboo.se/44704
_thom_hopes he can get in line to ask ReinH about his issue at http://pastie.caboo.se/44704
ReinHmeh
action_thom_ grins
_thom_grins
actionReinH hopes he can get some work done
ReinHhopes he can get some work done
djwonkReinH: http://pastie.caboo.se/44708
ReinH_thom_: what's the question?
_thom_ReinH: See the commented out line? With it, I get the default 'pick a value' prompt for the select. without it, I don't even see the prompt
ReinHdjwonk: why not use the login_as helper from acts_as_authenticated functional tests?
_thom_I just get the first value pulled from the db of payment types (this is the extra credit for the skateboard book, E1 'capturing an order' chapter)

Page: 3 10 17 24 31 38 45 52 59 66 73 80 87 94 101 108 

IrcArchive

NY Lost Funds