How can I pass and collect different options into a controller action.
E.g you have a Team model and you want to add or remove Users from the team?
I would assume this would go in the update action of the teams controller, but the update action also need to be able to update team details like name, address, ect.
I tried the following code but that produce some weird results to my css and produces errors.
link_to team_path(user), params[:add] ,:class => 'btn btn-mini pull-right', :method => :put
Weird results are probably caused by the mixed parentheses
But in general:
– you should add actions to the appropriate controller (prob. teams_controller) for
adding and deleting members:
and define routes in config/routes.rb to be able to use this actions (there are plenty of examples how that can be achieved in the comments generated), then you can use the resulting path helper for your link_to tag – check out the available routes and path helpers with