On Oct 14, 2011, at 6:58 PM, Tim Shaffer wrote:

> Is there any specific reason I'm not aware of that Rails still uses inline 
> JavaScript for this? Would there be any reception if I were to submit a pull 
> request for this? Never contributed to rails before so I'm not sure. Thanks!

I don't think you should change this. The reason it was done this way is to 
implement it in the easiest way possible, and that's just adding two extra 
attributes and no supporting code.

Your way would require removing this behavior from Rails and implementing it in 
JS. You would have to contribute to both Rails and rails-ujs & prototype-ujs 
projects, because the latter implement behaviors around data-* attributes. I 
don't think it's too much work, but I think that you shuldn't try to improve 
this. Ones who really care about properly doing image swapping will do so 
manually and handle advanced things like preloading of images.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to