I'm a rails beginner and I have an image detail view where just the image is displayed with a link.
The link url should redirect to the next image if it has the attribute show_image == false and if next image exists.
How can I do it?
at the moment it looks like this:
- if @picture.next.present? && (@picture.category.title == @picture.next.category.title)
%a.picture-show{ :href => "#{@picture.next.id}" }
= image_tag @picture.image.normal.url
- else
%a.picture-show{ :href => picture_path(params[:category_slug], @next.id) }
= image_tag @picture.image.normal.url