views:

11

answers:

0

I have such view:

<h1>Ajax show</h1>
Click this link to show the current
<%= link_to 'time', {:action => 'time', :update => 'time_div'}, :remote => true %>
<div id='time_div'>
</div>

Controller:

class PagesController < ApplicationController
  def formula
  end

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

And I add <%= javascript_include_tag :defaults %> to layout

When I click on the link "time" I get AJAX-request, but div id="time_id" doesn`t change. Why?