| faisal | unagi, 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%> |
| mike4263 | could anybody look at my code? this ajax is driving me crazy |
| stixl | where can I access the past log for this channel? |
| jshen | nukio: is there any reason you need to use a while loop? |
| solars | nukio, you could use a counter .. or a for loop :) |
| NewMonarch | Hey, what's the fastest way to do user-authentication on a small, unimportant app? Roll your own or use a generator or plugin? |
| jshen | nukio: how are you choosing the element? |
| nukio | jshen: yeah i want to return 6 results not the entire query's reqults |
| ghb1978 | try something like this nukio |
| jshen | nukio: from a db query? |
| nukio | jshen: yeah |
| korishev | NewMonarch: http://www.railscasts.com |
| solars | nukio, you can just use limit in the query? or a for loop over 6 items? |
| ghb1978 | @friend.each do |friend| puts friend end |
| jshen | nukio: why not select the right elements from the db query? |
| NewMonarch | korishev: "super simple" Sounds great! |
| jshen | nukio: if not use array.select |
| nukio | jshen: lets say i have 100 friends.. .i want to get the 100 friends... randomize the elements... and then return the top 6 |
| ghb1978 | ahh... ok |
| nukio | jshen: ah i could just add rand to the mysql query |
| korishev | NewMonarch: no prob.. collect the whole set |
| jshen | nukio: do that in sql. are you using mysql? |
| nukio | jshen: i spoke too soon ;) |
| ghb1978 | add a limit |
| nukio | jshen: if i wanted to do it in rails how would i do it? |
| NewMonarch | korishev: they're like Happy Meal toys! |
| jshen | nukio: 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! |
| gambi | I've installed a plugin but it dosn't appear? restarted webrick w/o any luck. did I miss something? |
| jshen | nukio: learn form my mistakes :) |
| solars | there is a wiki site that lists all possibilities for random records |
| nukio | jshen: good point ;) |
| solars | unfortunately the wiki is down :) |
| kwoody | nukio if the array is already randmized how about @friends.slice(0,6) |
| action | nukio is still worried about scalability... he's building a site that may have some 100000 ppl in a couple months |
| nukio | is 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 |