-
-
Notifications
You must be signed in to change notification settings - Fork 542
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
Allow redirects with symbols #4
Comments
@jodosha I can give it a try. Could you explain how the process looks from here ? |
@pkurek Thanks for looking at this.
Now we can override this behavior in I haven't implemented it yet because there is one thing to solve: get the right Because that override is at the higher level def redirect_to(url, status: 302)
headers.merge!(LOCATION => MyApp::Routes.url(url))
self.status = status
end This is a nice to have feature, but has some complications, so I would postpone after the first release. |
That's your call :) Are there any things I could help with? Cause the other 3 opened issues labeled as |
@pkurek they are all meant to be implemented for the next release. |
I was playing with this and was wondering if, instead of simply mokeypatching |
I was thinking about patching We could rely on |
How can we dynamically get the routes (or the application) object from within the action? We would need it to be injected somehow, right? |
@fuadsaud Now we have a constant that acts as a router wrapper. By convention, for a We could implement this feature by injecting a custom module into # lib/lotus/frameworks.rb
module Lotus::Frameworks::Action::NamedRedirect
private
def redirect_to(name)
# ...
end
end |
@fuadsaud ping, any update? |
This opens an inconsistency with routing helpers in views. Not a good idea. |
As now we have two ways to specify an URL for a redirect in an action:
By hardcoding the path:
By using the helper:
I would like to introduce a third way:
The text was updated successfully, but these errors were encountered: