-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Move respond_with to the responders gem #16526
Conversation
caching_with_rails.md |
@seuros good catch, thanks! |
@@ -21,7 +19,7 @@ def zero | |||
def create | |||
ActiveRecord::LogSubscriber.runtime += 100 | |||
project = Project.last | |||
respond_with(project, location: url_for(action: :show)) | |||
redirect_to "/" |
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.
shouldn't be ?
redirect_to url_for(action: :show, id: project.id)
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.
We are not testing the redirect location, it can be anything.
Nice work ! As for the responders gem, once you're sure about the version you'll pick for the next release, could you please add it to the generated |
👍 @robin850 I don't think we'll default to adding the gem in the Gemfile for new apps. |
respond_with (and consequently the class-level respond_to) are being removed from Rails. Instead of moving it to a 3rd library, the functionality will be moved to responders gem (at github.com/plataformatec/responders) which already provides some responders extensions.
Move respond_with to the responders gem
What was the rationale for removing this feature? It saw little use? |
Thanks! Good to know. |
I am wondering if I add responders gem into gemspec why will it still need to be added in Gemfile where gemspec is included in Gemfile. |
Is rails not using semantic versioning? This should not have been included in a minor release without providing backwards support for 4.x apps that use responders. A deprecation warning and request to move would have been OK, but breaking changes should have been done at 5.0. |
http://guides.rubyonrails.org/maintenance_policy.html
http://guides.rubyonrails.org/4_2_release_notes.html#respond-with-class-level-respond-to |
@runwaldarshu when adding something to the gemspec, it will add that library to your gem's dependency graph, so that when you On the other hand, the So, if you are packaging a gem/engine that uses
|
@rafaelfranca thanks for the clarification. Working with a student that is having a hard time getting responders loaded in her project. Since my last comment I upgraded an app to 4.2 without issue, but devise was included so it was already complaining that I needed the responders gem for that dependency to work. For me it was seamless, but apparently not for everyone. |
@jedschneider the version of Devise compatible with Rails 4.2 already include responders gem as dependecy https://github.com/plataformatec/devise/blob/v3.4.1/devise.gemspec#L28 |
@rafaelfranca FWIW had to |
@rafaelfranca worked through the student's issue. I think the confusion was associated with the installation of the responders gem, and the bootstrapping that it does with the generator, vs what you need to do directly in rails (just require). I'm not sure thats worth a note or not. |
@jedschneider yeah, installation of responders seems to confuse people. Maybe we should make explicit that the install process is optional at responders README. |
I've read through this but don't quite understand "why" the responders have been removed from rails. Is there a better way of doing this in rails 4.2 ? I should have checked here fires. Never mind. |
@lacostenycoder with variants and things like jbuilder this feature becomes out of date. The idea of variants would not work with it so we chose to just remove from the core. Pay attention that the feature is still supported, just outside of the default Rails stack. |
respond_with (and consequently the class-level respond_to)
are being removed from Rails. Instead of moving it to a 3rd
library, the functionality will be moved to responders gem
(at github.com/plataformatec/responders) which already provides
some responders extensions.