#rubyonrails - Fri 20 Apr 2007 between 02:53 and 17:04



faisalunagi, what are you trying to accomplish?
to show the author_id and the time with a comma between them?
if so you want <%= post.author_id %>, <%= post.time%>
mike4263could anybody look at my code? this ajax is driving me crazy
stixlwhere can I access the past log for this channel?
jshennukio: is there any reason you need to use a while loop?
solarsnukio, you could use a counter .. or a for loop :)
NewMonarchHey, what's the fastest way to do user-authentication on a small, unimportant app? Roll your own or use a generator or plugin?
jshennukio: how are you choosing the element?
nukiojshen: yeah i want to return 6 results not the entire query's reqults
ghb1978try something like this nukio
jshennukio: from a db query?
nukiojshen: yeah
korishevNewMonarch: http://www.railscasts.com
solarsnukio, you can just use limit in the query? or a for loop over 6 items?
ghb1978@friend.each do |friend| puts friend end
jshennukio: why not select the right elements from the db query?
NewMonarchkorishev: "super simple" Sounds great!
jshennukio: if not use array.select
nukiojshen: lets say i have 100 friends.. .i want to get the 100 friends... randomize the elements... and then return the top 6
ghb1978ahh...
ok
nukiojshen: ah i could just add rand to the mysql query
korishevNewMonarch: no prob.. collect the whole set
jshennukio: do that in sql. are you using mysql?
nukiojshen: i spoke too soon ;)
ghb1978add a limit
nukiojshen: if i wanted to do it in rails how would i do it?
NewMonarchkorishev: they're like Happy Meal toys!
jshennukio: generate 6 random numbers within the size of the array indices :)
nukio: but you should really do it in sql
nukio: what if you have 100,000 friends instead of 100. believe me. you don't want to create that array!
gambiI've installed a plugin but it dosn't appear? restarted webrick w/o any luck. did I miss something?
jshennukio: learn form my mistakes :)
solarsthere is a wiki site that lists all possibilities for random records
nukiojshen: good point ;)
solarsunfortunately the wiki is down :)
kwoodynukio if the array is already randmized how about @friends.slice(0,6)
actionnukio is still worried about scalability... he's building a site that may have some 100000 ppl in a couple months
nukiois still worried about scalability... he's building a site that may have some 100000 ppl in a couple months
kwoody: i never tht about that

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

IrcArchive