Download Facebook-Clone/app/views/api/posts/_post.json.jbuilder from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 617 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/Facebook-Clone/app/views/api/posts/_post.json.jbuilder
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/Facebook-Clone/app/views/api/posts/_post.json.jbuilder
-
curl -L -o _post.json.jbuilder https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/Facebook-Clone/app/views/api/posts/_post.json.jbuilder
617 Bytes
| json.extract! post, :id, :author_id, :wall_id, :body, :created_at | |
| json.photo asset_path(post.photo.url) | |
| json.authorfname post.author.fname | |
| json.profile_image_url asset_path(post.author.profile_image_url) | |
| json.wall post.wall | |
| if post.comments | |
| json.comments do | |
| post.comments.each do |comment| | |
| json.set! comment.id do | |
| json.partial! 'api/comments/comments', comment: comment | |
| json.authorid comment.author.id | |
| json.authorpic asset_path(comment.author.profile_image_url.url) | |
| json.authorf comment.author.fname | |
| json.authorl comment.author.lname | |
| end | |
| end | |
| end | |
| end | |