oomwrtu | hi all, if i have a route map.connect ':controller/search/:q', :action => 'search' what should the redirect be if i want to be sure :q is uppercase? i know to test it with if params[:q] != params[:q].upcase nvm i got it |
SlyGuy | will scaffold handle foreign key data? |
magic_hat | SlyGuy: any time you find yourself asking "will scaffold...." the answer is no. |
SlyGuy | hah that surprises me |
werdnativ | Anyone know of a helper for getting short excerpts from longer text? (for adding a "more..." link) ...I break mine on string length but I'd like something smarter that at least breaks between words. |
BigFisch | magic_hat: Since it's going through an ajax call, I'm not sure how to pull the current id. (since the controller is looking for an id) I get a Can't find Picture without an id. Any idea? |
magic_hat | basically scaffold does what everyone's seen it do in the rails video. beyond that, it's time to start building your own app. BigFisch: can you pastie the view? that would help. |
BigFisch | magic_hat: Sure thing pastie hi! pastie: hey! |
pastie | http://pastie.caboo.se/53199 by BigFisch. |
SlyGuy | well it really wouldn't be that hard to scaffold a drop down list :) |
magic_hat | lol BigFisch: form_remote_tag :url => { :action => 'rate', :update => 'rating' , :id=>@picture } |
BigFisch | magic_hat: thanks a lot :) Missing template script/../config/../app/views/pictures/rate.rhtml ? |
magic_hat | BigFisch: do you want anything to happen on the page after the user rates the photo? or just store info in db? |
BigFisch | BigFisch: for now I'd just like to see it work (db) but maybe have it update a 'ratings' div. I don't want the page to redirect or anything, just stay there. |
wackimonki | guys, how do i create a sweeper for my ActiveRecordStore sessions? i can find this info anywhere |
magic_hat | okay, so any time you do a controller action it tries to render a view with the same name. you need to tell it not to render anything. I'll let you figure that by yourself. |
wackimonki | can't* |
BigFisch | magic_hat: Nice ;) - thanks sir. |
magic_hat | wackimonki: it's in the agile web dev book. |
lrojas | testing 1 2 3 |
wackimonki | magic_hat, i'm reading that bit. it is not clear where i can put the 'delete from' command do i create a sweeper for application_controller? do i 'observe' any models'? if i observe a model, wouldn't that be slow. |
magic_hat | wacki: basically you just want to delete sessions that are more than x days old. |
wackimonki | sure, how do i do that? |
magic_hat | lol read the activerecord chapters :) |
wackimonki | gah, ok. i might leave it for now |
magic_hat | wackimonki: it's not super hard, and it's info you're gonna need to understand well before you get the rest of the app working anyway. |
macographer | does ruby recognize the \w special regexp character? |
LoganCapaldo | macographer: try and see |
wackimonki | yea, i know. i was just being lazy. on to it now |
macographer | heh. |