Access the visible model from actions #1404
Replies: 1 comment
-
You should be able to access the
Let me make sure I understand correctly. So you are on |
Beta Was this translation helpful? Give feedback.
-
You should be able to access the
Let me make sure I understand correctly. So you are on |
Beta Was this translation helpful? Give feedback.
-
I'd like to be able to access the model that is currently being viewed from actions, because I have many actions that act on the resource that you've editing/viewing.
If I am on a show or edit page, I can get access to a resource for that page but the model is nil (I'm not sure why). At the moment I can access the current model from the
:models
parameter but if the user has selected any associated models (eg. in a has many) then:models
is set to those models (rather than the currently viewed resource). Perhaps there is already a way to do this and I've missed it?Beta Was this translation helpful? Give feedback.
All reactions