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.