:javascript $(document).keydown(function(e){ switch(e.keyCode) { case 37: window.location.replace( "#{url_to_prev(@photo,@album)}" ); break; case 39: window.location.replace( "#{url_to_next(@photo,@album)}" ); break; } }); .back= link_to "⇧ #{@album.name}", album_path(@album) %h1.big_text = @photo.image .right = link_to 'Edit Photo', edit_photo_path(@photo), :class => "button" .sub_header = link_to "<< prev", url_to_prev(@photo, @album) | = link_to "full size", @photo.url | = link_to "next >>", url_to_next(@photo, @album) %div{:id => @photo.id} #show_photo = linked_scaled_photo @photo, @album .caption = @photo.caption #content_bottom .back = link_to "⇧ #{@album.name}", album_path(@album) -if current_user.owns? @album .right = link_to 'Delete Photo', @photo, :confirm => 'Are you sure?', :method => :delete, :class => 'button' %h4{:class => "show_post_comments"} = "comments (#{@photo.comments.count})" = render "comments/comments", :post => @photo