11175
(-- --)
April 13, 2008, 8:37am
#1
AFAICT, this is all I need to do to get a simple example working:
the <head> should have this:
<%= javascript_include_tag :defaults %>
My test page view should have a div with an id and the ERB like this:
<%= link_to_remote 'Click Me',
:url => {:action => 'show_time',
:update => 'time_box'} %>
<div id="time_box"></div>
The controller for my test page should have this:
def show_time
layout false
render_text "Time: " + DateTime.now.to_s
end
I know there's various options for several of the details in there, but
shouldn't this example work as is?
However, I get no response from this code.
What am I missing?
11175
(-- --)
April 13, 2008, 8:50am
#2
Greg Willits wrote:
AFAICT, this is all I need to do to get a simple example working:
<%= link_to_remote 'Click Me',
:url => {:action => 'show_time',
:update => 'time_box'} %>
ACK, found it -- the } was in the wrong spot.
Now to get a view template to be used for the response. I thought one
would just automatically get used, but apparently not?
Dan_Sharp
(Dan Sharp)
April 13, 2008, 1:44pm
#4
Greg,
Glad to see you got this working! I used to encounter the same types
of things... weird errors that turned out to be obscure syntactic
mistakes (like a wrongly placed or missing } in your example).
In these cases, the API docs are indispensible.. to know when you need
a hash or a hash of hashes, or stuff like that.
-Danimal