This helper is simply because I'm lazy. Instead of typing out the longer image_tag url_for_file_column(blah, blah, blah), I simplified my life a little.
In addition, it makes it easier for my list view to be able to use the paging instead of redoing the finds with extra conditions; and I can use the helper from anywhere in the site since it's in the application_helper.rb.
Call it from anywhere in your views withdef get_image(id)<br />     @photo = ListingImages.find(id)<br />     image_tag url_for_file_column(@photo, "image", "thumb")<br /> end
get_image(photo.id)
Now isn't get_image much shorter than the alternative?
You've got to love the simplicity of Rails!









On Tuesday, May 23
This helper is simply because I'm lazy. Instead of typing out the longer image_tag url_for_file_column(blah, blah, blah), I simplified my life a little.
In addition, it makes it easier for my list view to be able to use the paging instead of redoing the finds with extra conditions; and I can use the helper from anywhere in the site since it's in the application_helper.rb.
Call it from anywhere in your views withNow isn't get_image much shorter than the alternative?
You've got to love the simplicity of Rails!
file_column website
On Tuesday, Sep 26
thank you, nice write up!