resolved ActionController::InvalidAuthenticityToken error by adding <%= csrf_meta_tags %> to the layouts