0

I know that in rails 2.3 there is :with option available with link_to form helper. The use of it is basically the append parameters to URL. But in rails 3.1 its not working, how can i append more parameters to path using link_to in rails 3.1. Here is how it worked in rails 2.3

I need to append to my path something i get from javascript.

<%= link_to "Edit", {:url => error_prone_teacher_students_path(@store), :remote => true, :with => "'id='+$('#id').val()", :method => :get}, :id => "load", :style=>"display:none;" %>
opensource-developer
  • 2,826
  • 4
  • 38
  • 88

3 Answers3

2

Rails 3 no more support this behaviour you have to create the form to submit value.

santosh dadi
  • 334
  • 1
  • 8
0

You can do like this

<%= link_to "Edit", error_prone_teacher_students_path(@store) + "?id=parameter", :remote => true, :method => :get, :id => "load", :style=> "display:none;" %>

Hope this helps!

Rajdeep Singh
  • 17,621
  • 6
  • 53
  • 78
0

Try this.

link_to "EDIT", error_prone_teacher_students_path(@store, q1: 1, q2: 2)