I was just wondering, I have a model that, besides the id’s from other models (FK), it has a single attribute boolean. I want to know how can I create a button that changes this boolean and just that
My model in question is this one:
class Squad
belongs_to :player
belongs_to :team
end
I want to create a button on the team#show page so the player that owns this team can change the boolean of squad. How can I do this and how would look like my controllers?
Thanks :)!
-Edit-
I’m using a link like this:
<%=link_to("Change status", squad_path(sqd, :status => true), :method => :put, :confirm => "Sure?")%>
Where sqd is part of my query. Is this link wrong?
in your controller (it is pretty common)