-
Notifications
You must be signed in to change notification settings - Fork 214
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
Adding the RedirectToOverrides to enable redirect_to also for remotipart submitted actions. #102
base: master
Are you sure you want to change the base?
Conversation
…art submitted actions
👍 +1 using this successfully in production |
include ERB::Util | ||
|
||
def self.included(base) | ||
base.class_eval do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use send
instead of class_eval, it will make code faster.
@JangoSteve any chance of getting this merged? |
@johnnyshields I'll check this. |
|
||
def redirect_to_with_remotipart *args | ||
if remotipart_submitted? | ||
case redirect_path = args.shift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to handle the case of something like redirect_to @post
Would love to see this merged, just ran into it today -- working around it by vendoring the above file and including in |
Currently, remotipart only allows us to render partials with ajax forms having file uploads. This PR provides a class 'RedirectToOverrides' similar to existing 'RenderOverrides' that can handle 'redirect_to' in case of file uploads done via remotipart.