Render :update working incorrectly

I have the following code

render :update do |page|
page.alert(‘Hey there’)
end

Why is it taking me to a blank page with the following text at the top:

alert(“Hey there”);

This text is in

 tags as well. Its kinda weird. Thats what I want
to execute on the page that it came from. Any ideas?

This happens with the other commands where it renders the javascript for
the command than puts that javascript on a blank page.

On 7/28/06, Eric G. [email protected] wrote:

alert(“Hey there”);
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

How are you calling this? is it with link_to_remote or within a
form_remote_tag

If you just put it straight into a link_to then it will redirect you to
a
new page and display the results of the action.

well, i didnt have the form_remote_tag so I put it in. I now have

<%= form_remote_tag(:html=> {:id=> “signup_form”},:url => { :action =>
:tester }) %>

as my form tag. The method is as follows:

def tester
render :update do |page|
page.insert_html(:after, ‘sport1’, ‘working’)
end
end

Again, I still get “new Insertion.After(“sport1”, “working”);”

on a blank page. What am I doing wrong. I have no plugins installed
either that might conflict.

How are you calling this? is it with link_to_remote or within a
form_remote_tag

If you just put it straight into a link_to then it will redirect you to
a
new page and display the results of the action.

On 7/28/06, Eric G. [email protected] wrote:

render :update do |page|


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

Do you have a layout definied with

<%= javascript_include_tag :defaults %>

It sounds like you don’t have the prototype.js file loaded into your
page.
The prototype file is the default set of scripts that provides ajax
functionality. You will need to include them

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs