Notes posted by newdark
RSS feedClarification with use of update_all
I would like to point out that if you are on rails 2.3.11 or lower you will not be able to run ledermann code.
Ledermann Code
user.messages.update_all(:read => true)
If you are running 2.3 or later it you will have to use James code
James Code
Message.update_all({:read => true}, {:id => user.messages})
thanks guys for all the code help
Recommendations
I would just use the path_to_image. I find that this is what works best. As it says above it can create problems.
Here is my code
Code example
def background_path(background) if background path_to_image background.file_name.normal else path_to_image "background_preview.jpg" end end def flavor_path(flavor) if flavor path_to_image flavor.file_name.normal else path_to_image("flavor_preview.jpg") end end
basic but gets the job done and it does not have problem with my pre built paths which are called image_path


