#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 
Top Prev 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 Next

#rubyonrails

<brndn> hey i've got a quick question i want to take a variable name in my view and add a quick suffix to it. how do i do that?
<tpope> what is a variable name?
<tpope> and what is a suffix?
<tpope> these are serious questions
<brndn> the variable is style.shirt_image and the suffix is _small.jpg
<locellcount> has anyone found a way to turn off the ?1170420126 crap at the end of images and stuff yet?
<halorgium> locellcount: why would you want to?
<dagbrown> Yes, go in and change the source code for Rails itself
<dagbrown> (Or y'know, reopen that class and redefine that method)
<wangslanger> locellcount & halorgium: what is their use/intent?
<locellcount> doesn't it interfere with browser caching?
<wangslanger> brndn: are you trying to change the variable name, or the variable contents?
<tpope> locellcount: by design
<dagbrown> No, it's to help browser caching
<halorgium> it does on purpose
<dagbrown> It's just the timestamp of the image file
<tpope> apparently the variable content
<dagbrown> If you change the image file, it gets a new number, otherwise it doesn't
<dagbrown> So that way you don't get browsers downloading old images when they should have new ones.
<tpope> brndn, style.shirt_image + "_small.jpg"
<locellcount> ah... in that case... let the crap REMAIN!
<Bongo`> Wow, that feature was neat
<brndn> gracias!
<wangslanger> tpope: why + instead of << ?
<tpope> because << modifies the value
<tpope> do you want to modify the string?
<brndn> no thanks that's perfect
<wangslanger> :D
<brndn> if it appends the output of the variable in my view
<wangslanger> + creates a new string with the two strings joined together
<wangslanger> << appends the right-hand string onto the left-hand, changing it in the process
<nasr100> controller question for everyone. if i want to have a index page for myapp, so myapp.com which implicitly maps to index.html but I still want it to go throug the controller how can I map this in ruby?
<tpope> routes
<nasr100> so i would just hard code this one particular route
<green-mouse> Hi all. somebody know how I can get value of property of DOM element in controller?
<tpope> though "to index.html" and "through the controller" are contradictory
<tpope> sure
<nasr100> but keep everyhting else just using the default rails mapping convention?
<wangslanger> green-mouse: $('objectID') will get you the object
<tpope> yeah, or break the convention inother places
<tpope> the DOM is client side, the controller is server side
<green-mouse> wangslanger: thanks!
<wangslanger> tpope: snap, didn't notice the "controller" part
<nasr100> tpope: yes i understand they are contracdictory. basically what i am trying to achieve is having a index page which search engines spider so i believe i will need a high level controller that maps to myapp.com/ requests
<tpope> nasr100, I wasn't talking to you with that
<tpope> err
<tpope> yeah I wasa
<tpope> two contradictions in the last 5 minutes
<nasr100> tpope..hehe..no worries
<tpope> I just mean, index.html is a static file

Previous Page  Next Page

Search ircarchive.info