Table of Content
Extracting view code to helpers
Helper is used to abstract view methods. It is designed for using in view.
app/helpers/photos_helper.rb
file:
So now, the photo url can be like this:
1json.thumb_url absolute_photo_url(photo, :thumb)
What’s next? We’re going to take a look at “Partial json views”.