title: How to convert existing rjs to use jQuery in Rails 4
body: <p>Right Now, I have rails 2 application that I'm converting into Rails 4, I'm getting problem to understand rjs structure and unable to convert into jquery </p>
  
  <p>This is my rjs code. </p>
  
  <pre><code>page &lt;&lt; %Q(if ($("patient_visit_detail_fee_schedule_wrapper")) {)
    replace = select_tag("patient_visit_detail[fee_schedule_id]",
         options_for_select((@procedure_code ? @procedure_code.procedure_codes_fee_schedule_labels.active.map{|fs| [fs.fee_schedule_label.label, fs.id]} : []), ((@procedure_code and !@procedure_code.default_fee(@patient_case).nil?) ? @procedure_code.default_fee(@patient_case).id : nil)),
         :onchange =&gt; "feeScheduleChanged(this.value)"
    ).gsub(/[\n\r]/, "")
  
    page &lt;&lt; %Q($("patient_visit_detail_fee_schedule_wrapper").set("html", '#{replace}'))
  page &lt;&lt; "}"
  
  fee = @procedure_code.default_fee(@patient_case)
  unless fee.nil?
    amount = fee.fee_in_dollars || 0.to_money
    page.call("$('patient_visit_detail#{@element_suffix}_amount_in_dollars').set", 'value', amount.to_s)
  end
  </code></pre>
  
  <p>I'm really stuck on how I would go about keeping the same functionality. How can I accomplish this using jQuery?</p>
  
  <p>Thanks In Advance.</p>