Adding data to controller on button

This button feeds into the index function on my controller. conn gets passed into the function, how do I pass in other data?

I wanted to pass in data inside a variable like @my_data but it doesn’t seem to pass through. It gets lost.

<%= button "Click here", to: Routes.app_path(WebApp.Endpoint, :index), method: :put %>

Buttons are traditionally used with forms, and forms would let you pass in additional data by creating hidden form elements.

1 Like