Peter Michaux
2006-Jul-03 22:28 UTC
[Rails] rjs renders string or partial but not template or action
Hi, I have an rjs file. I only have one controller called called front. I have views called "new_title.rhtml" and "_new_title.rhtml" These work page.replace_html ''title'', ''new title'' page.replace_html ''title'', :partial => ''new_title'' page.replace_html ''title'', {:file=>"front/new_title", :use_full_path=>true} but these don''t page.replace_html ''title'', :template => ''front/new_title'' page.replace_html ''title'', :action => ''new_title'' page.replace_html ''title'', :controller => :front, :action => :new_title This make alert boxes in my browser. "RJS error html has no properties" and "Element.update(''title'', null);" Anyone know why the last three don''t work? Thanks, Peter
Zack Chandler
2006-Jul-20 21:10 UTC
[Rails] rjs renders string or partial but not template or action
Peter, Did you ever get this answered? I have used RJS a ton but only recently had the need to render a template from RJS (usually partials are fine). Anyone have the answer? Thanks, Zack On 7/3/06, Peter Michaux <petermichaux@gmail.com> wrote:> Hi, > > I have an rjs file. I only have one controller called called front. I > have views called "new_title.rhtml" and "_new_title.rhtml" > > These work > > page.replace_html ''title'', ''new title'' > page.replace_html ''title'', :partial => ''new_title'' > page.replace_html ''title'', {:file=>"front/new_title", :use_full_path=>true} > > but these don''t > > page.replace_html ''title'', :template => ''front/new_title'' > page.replace_html ''title'', :action => ''new_title'' > page.replace_html ''title'', :controller => :front, :action => :new_title > > This make alert boxes in my browser. "RJS error html has no > properties" and "Element.update(''title'', null);" > > Anyone know why the last three don''t work? > > Thanks, > Peter > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Chris T
2006-Jul-23 17:49 UTC
[Rails] rjs renders string or partial but not template or action
+1 for finding a good way to do this. I ended up using a partial (which could be called by the rjs), and then having a template with a single line in it calling the partial. Works fine, but has a bit of a smell Zack Chandler wrote:> Peter, > Did you ever get this answered? I have used RJS a ton but only > recently had the need to render a template from RJS (usually partials > are fine). > > Anyone have the answer? > > Thanks, > Zack > > On 7/3/06, Peter Michaux <petermichaux@gmail.com> wrote: >> Hi, >> >> I have an rjs file. I only have one controller called called front. I >> have views called "new_title.rhtml" and "_new_title.rhtml" >> >> These work >> >> page.replace_html ''title'', ''new title'' >> page.replace_html ''title'', :partial => ''new_title'' >> page.replace_html ''title'', {:file=>"front/new_title", >> :use_full_path=>true} >> >> but these don''t >> >> page.replace_html ''title'', :template => ''front/new_title'' >> page.replace_html ''title'', :action => ''new_title'' >> page.replace_html ''title'', :controller => :front, :action => :new_title >> >> This make alert boxes in my browser. "RJS error html has no >> properties" and "Element.update(''title'', null);" >> >> Anyone know why the last three don''t work? >> >> Thanks, >> Peter >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >