У меня есть контроллер:
class QuestionsController < ApplicationController
def hello
puts "====================!!!==================="
@hello = "hey"
"some"
end
def test
end
test.rhtml:
<%= javascript_include_tag :defaults %>
<br/>
Click this link to show the current
<br/>
<%= link_to "hello",
{ :controller => "questions", :action => "hello" },
:update => 'time_div',
:remote => true %>.
<br/>
<div id='time_div'>
...
</div>
Когда я нажимаю ссылку 'hello', я вижу, что был вызван метод hello (), но htmlстраница остается прежней.Почему?
Как мне нужно изменить код для обновления HTML-страницы?
Вот сгенерированная HTML-страница:
<!DOCTYPE html>
<html>
<head>
<title>Stack</title>
<script src="/javascripts/jquery.js?1286229922" type="text/javascript"></script>
<script src="/javascripts/jquery-ujs.js?1286229922" type="text/javascript"></script>
<meta name="csrf-param" content="authenticity_token"/>
<meta name="csrf-token" content="UKPX1dNCZhyTk8u71hR9KaUmufIire7Rhvg8t7cRSlM="/>
</head>
<body>
<br/>
Click this link to show the current
<br/>
<a href="/questions/hello" data-remote="true">hello</a>
<br/>
<div id='time_div'>
...
</div>
</body>
</html>