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 <pre> 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. -- Posted via http://www.ruby-forum.com/.
On 7/28/06, Eric Gross <tennisbum2002@hotmail.com> wrote:> > 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 <pre> 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. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/railsHow 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. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060728/e6334120/attachment.html
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'', ''<b>working</b>'') end end Again, I still get "new Insertion.After("sport1", "<b>working</b>");" 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.-- Posted via http://www.ruby-forum.com/.
On 7/28/06, Eric Gross <tennisbum2002@hotmail.com> wrote:> > 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'', ''<b>working</b>'') > end > end > > Again, I still get "new Insertion.After("sport1", "<b>working</b>");" > > 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. > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/railsDo 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060728/1ea2a205/attachment.html