at application.html.haml, change the input hidden tag to hidden_field_tag, at photos_controller in index action, change array to hash in json format. and fix update_latest_photos.js.erb