Add edit posts in Ruby and JS