Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow response in Forms not working for PUT or PATCH requests #403

Open
NdotHenning opened this issue Mar 17, 2020 · 0 comments
Open

Follow response in Forms not working for PUT or PATCH requests #403

NdotHenning opened this issue Mar 17, 2020 · 0 comments

Comments

@NdotHenning
Copy link
Member

What is the current behavior?
follow_response funktioniert nicht für method: :put oder method: :patch. Wenn ich in einer Form bei success eine Transition auf einen anderen Pfad machen möchte, wird, wenn die Form mit put/patch submitted wurde, vom Server der angegebene Pfad mit method: :put/patch angefragt. Für eine Form submitted mit method: :post wird bei follow_response: true die erhaltene URL mit GET beim Server angefragt.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug might get fixed faster if we can run your code and it doesn't have extra dependencies. Add a link to a sample repo and/or any relevant code below:

# A edit page

def response
  components {
    form form_config, :include do
      form_submit do
        button text: 'submit'
      end
    end
  }
end

protected

def form_config
    {
      for: some_model,
      path: some_model_path(some_model),
      method: :patch,
      failure: {
        emit: 'form_failure'
      },
      success: {
        transition: {
          follow_response: true
        }
      }
    }
  end
# controller

def edit
  render Pages::Edit
end

def update
  some_model = SomeModel.find(params[:id])
  redirect_to edit_some_model_path(some_model)
end

What is the expected behavior?
Request the redirect_to path from the controller action as GET. Like it is happening for method: :post.

Which versions of Matestack, and which browser/OS are affected by this issue? Did this work in previous versions of Matestack?

Matestack 0.7.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant