I have a lot of resources nested under 1 common resource. For example a blog hosting site which has the following resources:
resources "/blogs", BlogController do resources "/comments", CommentController resources "/posts", PostController resources "/users", UserController end
In just about every request I need the blog struct, rather than adding “blog_id” => blog_id in all the controller signatures then making a db call I thought it might be wise to have some plug middle-wear to put the blog struct on conn.
Is this concept a good idea or is there a better practice?