Nope, still b0rked - here’s all the source
(and there’s a tarred up app directory at
http://files.hellooperator.net/aj.tgz
)
Thanks for everyone’s suggestions so far, and apologies in advance
for when it turns out to be a typo…
sisred@planb:~/Desktop/aj$ cat app/views/ajax_test/_form.rhtml
<% if @guess %>
don't think '<%= h(@guess) %>' is right....
<% end %>
<%= form_remote_tag(:update => ‘update_div’,
:url => { :action => :guess }
) %>
thick as 2 short…?
<%= text_field_tag :guess %>
<%= submit_tag ‘do the ajax thing’ %>
<%= end_form_tag %>
sisred@planb:~/Desktop/aj$ cat app/views/ajax_test/guess.rhtml
AjaxTest#guess
Find me in app/views/ajax_test/guess.rhtml
sisred@planb:~/Desktop/aj$ cat app/views/ajax_test/_form.rhtml
<% if @guess # if it was right, we wouldn't be rendering this partial %>
don't think '<%= h(@guess) %>' is right....
<% end %>
<%= form_remote_tag(:update => ‘update_div’,
:url => { :action => :guess }
) %>
thick as 2 short…?
<%= text_field_tag :guess %>
<%= submit_tag ‘do the ajax thing’ %>
<%= end_form_tag %>
sisred@planb:~/Desktop/aj$ cat app/views/ajax_test/index.rhtml
have a guess
<%= render(:partial => 'form',
:layout => false ) %>
sisred@planb:~/Desktop/aj$ cat app/controllers/ajax_test_controller.rb
class AjaxTestController < ApplicationController
def index
end
def guess
@guess = params[:guess] || ‘’
if @guess.strip.match /^planks$/i
render(:text => ‘right on commander’)
else
render(:partial => ‘form’, :layout => false)
end
end
end
On 11/01/06, Dave T. [email protected] wrote:
b) some interaction between ajax and partials
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
–
Rasputin :: Jack of All Trades - Master of Nuns
http://number9.hellooperator.net/