Reputation: 189
I am trying to open a form via remote:true
method. The form which i am opening has a @projects
variable. How can i pass this @projects
variable via link_to
method.
<%= link_to "", project_path, remote:true, class="icon", id:"icon" %>
Upvotes: 1
Views: 355
Reputation: 3203
You can use following code
<%= link_to "", project_path(:projects => @projects), remote: true, class: "icon", id: "icon" %>
or
<%= link_to "", project_path(projects: @projects), remote: true, class: "icon", id: "icon" %>
Upvotes: 1