nitter
Stefan Tilkov
@stilkov
20 Dec 2012
+1 RT
@mikekelly85
: Hypermedia APIs on Rails: why
@dhh
should “give a fk”
blog.stateless.co/post/38378…
Dec 20, 2012 · 12:49 PM UTC
1
1
5
DHH
@dhh
20 Dec 2012
Replying to
@stilkov
@stilkov
@mikekelly85
This is already possible, easy even, with jbuilder. What more is Rails supposed to do about it?
1
Stefan Tilkov
@stilkov
20 Dec 2012
@dhh
@mikekelly85
Nice, I didn't know about that. Is it included with Rails by default?
1
more replies
DHH
@dhh
20 Dec 2012
Replying to
@NicerInPerson
@mikekelly85
@stilkov
I'm not a big fan of model serialization for public APIs. The hand-crafted ones in jbuilder make this super easy.
4
Stefan Tilkov
@stilkov
20 Dec 2012
@dhh
@mikekelly85
Fully agree, am personally allergic to the term "serialization" in the first place
DHH
@dhh
20 Dec 2012
Replying to
@NicerInPerson
@mikekelly85
@stilkov
link_to
@product
vs <a href="/projects/#{
@product
.to_param}>. First is cleaner, simpler.
1
Stefan Tilkov
@stilkov
20 Dec 2012
@dhh
I thought the main point of route helpers was to remain DRY with regards to routes.rb? If so, I agree with
@mikekelly85
: Same in client
Stefan Tilkov
@stilkov
20 Dec 2012
Replying to
@NicerInPerson
@mikekelly85
@dhh
It could include links even if it does not use an established media type :-)
DHH
@dhh
20 Dec 2012
Replying to
@NicerInPerson
@mikekelly85
@stilkov
Jbuilder commented out is pretty good in the box offer. Yehuda has a serialization gem approach too.
DHH
@dhh
20 Dec 2012
Replying to
@NicerInPerson
@mikekelly85
@stilkov
But, in the grand scheme of things, no, I don't think including urls in your API returns is overwhelmingly important.
DHH
@dhh
20 Dec 2012
Replying to
@NicerInPerson
@mikekelly85
@stilkov
Why I don't think it's that important? For starters, the scenario proposed extremely rarely happens.
Load more