0

I have sample application, which works fine, but needs older Rails' version. Here is controller code:

class AjaxController < ApplicationController
  def show
  end

  def time
    render text: "The current time is #{Time.now.to_s}"
  end
end

And here is view code:

<%= javascript_include_tag :defaults %>
<h1>Ajax show</h1>
Click this link to show the current 
<%= link_to_remote "time", 
    :update => 'time_div', 
    :url => {:action => "time"} %>.<br/>
<div id='time_div'>
</div>

Rails 4.0.2 doesn't have 'link_to_remote', but does have :remote attribute in 'link_to'. But this code doesn't work even with this replacement. What should I do? Thank you.

John Doe
  • 59
  • 1
  • 4
  • Please post your updated view code with `link_to` which isn't working. – steve klein Jul 10 '15 at 15:53
  • possible duplicate of [Rails 2 to Rails 3 : using link\_to instead of link\_to\_remote (including remote and update)](http://stackoverflow.com/questions/5511787/rails-2-to-rails-3-using-link-to-instead-of-link-to-remote-including-remote-a) – Kristján Jul 10 '15 at 15:59

0 Answers0