I'd assume that this is something that's new, and totally different from the way we implement REST resource endpoints. So, I'd assume that we don't need that for now.
By the way, these 'please add support for xxx' request usually just go to trash faster than you thought. I'd suggest to make a topic asking whether the core team interest in this kind of feature or not, then you implement it and send in a pull request.
Also, for something that's totally new like this, it might even worth to make a gem for it first, then I'm pretty sure the core team will pull it in if they found out that it's useful.
On Thursday, September 6, 2012 at 9:45 AM, Steve Klabnik wrote:
Im at Windy City Rails today, but expect a long-ish response in a few hours.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
What would ActiveRecord need? It already has methods to upload just
certain columns.
> Instead of just sending
> request params with data for updates from forms, you'd want to send JSON,
Whoah, HTML doesn't work this way. It sends
application/www-url-form-encoded from forms, this isn't gonna change.
This means that HTML can't (in general) take advantage of PATCH. It
can't take advantage of PUT or DELETE either. Such is life.
> And that wouldn't map up to the right attributes, because it isn't meant to
> take a patch.
Ah, sure. So now we're getting to something. What would you propose in
this area?
> It would be an edge case, but the default generation of a scaffold supports
> json format, right? Doesn't that indicate that it should support all of the
> features like accepts_nested_attributes_for that can be set on a model?
Sure, but only displaying, not receiving. So I'm not sure how Rails
would help here.
> True that would be the case for HTML forms, which would be the case if the
> browser didn't support javascript and the page gracefully degraded to use
> HTML forms. However, Javascript could eliminate the form altogether and send
> JSON with a different mime type (for the JSON patch) in the update form
> perhaps.
This would be a super crazy change that basically everyone on the core
team would -1, for sure.
There's that word again, practicality. This is the opposite of theory. Gary, if you change your approach to a more practical demonstration than just theory, I think you'll find better receptivity. This means: you, write a simultaneous-multiuser-updating demo site that needs/uses json patch, fork or gem whatever framework you need to make it happen. Your work and/or ideas will surely get folded into their respective frameworks (like rails and angular) once people see the practical benefit through working code.
Let he with the most enthusiasm for it be the first to do so (and if nobody does, then I guess it wasn't needed enough.. yet).
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/zkvt-OdMJ1wJ.
Have you seen Jose's active model serializers? It's way better than the default.
has_many :riders, class_name: Person.meta(:std, attrs: [:name, :seat_preference]).name
But, it would be nice to do something more like what Nick Sutterer is doing with Roar representers