Simplified the pins_controller.rb