At http://localhost:3000/books
, I have an index page where I have a list of books.
When you click on one of the links, the action to which it is bound, book
, gets fired:
However, when you click on one of the links from one of the book pages, the book
action doesn't get fired:
Note that the URL does change when the links are clicked, from both the index page and the book pages, but the problem that I'm having is that book
doesn't get activated when you click on a link to a book page from another book page. How can I fix a situation like this?
FYI, here is a repo where this problem can be reproduced.
As it turns out, Volt computations are a way to solve this problem. By using the params
collection, you can attach computations to changes in the URL. I solved this issue and got book
to run on changes in the URL like so: https://github.com/ylluminarious/volt_action_problems/commit/5fcefc16d7b14a980f68ce572a80f25540d21636.