Answers for "ways of passing parameters to link_to in rails"

0

rails pass params in url

/path/to/resource?queryKey=queryVal
Posted by: Guest on November-08-2021
0

transfer parameters in link_to rails

<% @user.tasks.each do |task| %>
	<%= link_to "delete #{task.name}", user_delete_task_path(@user, task_id: task.id), method: :post %>
<% end %>
# => create params[:task_id]
Posted by: Guest on December-02-2020

Browse Popular Code Answers by Language