Phoenix Inside Out (series of books/booklets) (self-published)

Does anyone here of this? Let me know what you guys think. Thanks.

2 Likes

Hello @shankardevy,
Are there any solutions to the exercises in the book Ecto Cookbook ?

Hello @all,
In the above mentioned book there is an exercise as follows,


Create a commentsļ»æ table with the following field

Field name Type
body String
author_id Foreign key references users
recipe_id Foreign key references recipes

In this table the foreign key references should follow the conditions below:

  1. an user cannot be deleted if there is at least one comment made by that user.
  2. when a recipe is deleted, all comments referencing to that recipe should also be deleted.ā€

Excerpt From
Ecto Cookbook
Shankar Dhanasekaran


In the first condition it asks to make the migration in a way that if there is at least one comment the author canā€™t be deleted, but I think the on_delete: :nothing should be added to the :users, and for the second condition on_delete: :delete_all should be added to the :recipes table, because in both the cases records in the :comments table are child records.
Or is my mind mixed up right now and Iā€™m missing something?

How do you feel about this today?
I really like the premise of the book, but it does not cover liveview.

1 Like

Will someone please help me with this? I canā€™t go forward if this step is not clear.

Thank you!