Hi, everyone! I have a question. when I created a controller and a action like this: class EverythingController < ApplicationController def index end def findname content="here is test" render :text => content, :layout => false end .. end in other controller''s .rhtml, I used <%= render_component :controller => "everything", :action => "findname" %> so, Do I need create a template _findname.rhtml for findname action? I don''t think I need it, because I just render content, not anything. but when I do function test, there is error: Misstemplate _findname.rhtml so I don''t understand this error. who can tell me why? and how can fix it, Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, everyone! I have a question. when I created a controller and a action like this: class EverythingController < ApplicationController def index end def findname content="here is test" render :text => content, :layout => false end .. end in other controller''s .rhtml, I used <%= render_component :controller => "everything", :action => "findname" %> so, Do I need create a template _findname.rhtml for findname action? I don''t think I need it, because I just render content, not anything. but when I do function test, there is error: Misstemplate _findname.rhtml so I don''t understand this error. who can tell me why? and how can fix it, Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Oct 25, 2007, at 9:58 AM, OnRails wrote:> class EverythingController < ApplicationController > def index > end > > def findname > content="here is test" > render :text => content, :layout => false > end > .. > end > in other controller''s .rhtml, I used > <%= render_component :controller => "everything", :action => > "findname" %> > > so, Do I need create a template _findname.rhtml for findname action? > I don''t think I need it, because I just render content, not anything. > but when I do function test, there is error: Misstemplate > _findname.rhtml > so I don''t understand this error. > who can tell me why? and how can fix it, Thanks!Have a look at this article (and example code) which explains how to use & combine views, partials, and layouts. http://gregwillits.wordpress.com/2007/10/16/modular-page-layouts-in- ruby-on-rails/ -- gw --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> Hi, everyone! > I have a question. when I created a controller and a action like this:Hrm... not sure about your specific problem, but components won''t be supported in Rails 2.0 which is just around the corner... http://www.rubyonrails.org/deprecation Might want to rethink what you''re trying to do to use another method...> > class EverythingController < ApplicationController > def index > end > > def findname > content="here is test" > render :text => content, :layout => false > end > .. > end > in other controller''s .rhtml, I used > <%= render_component :controller => "everything", :action => > "findname" %> > > so, Do I need create a template _findname.rhtml for findname action? > I don''t think I need it, because I just render content, not anything. > but when I do function test, there is error: Misstemplate > _findname.rhtml > so I don''t understand this error. > who can tell me why? and how can fix it, Thanks! > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
yes, I have looked this article. but I just want to know If I used "render :text =>" to render something view not whole page, Do I need create template? On Oct 25, 10:08 am, Greg Willits <li...-0Bv1hcaDFPRk211Z5VL+QA@public.gmane.org> wrote:> On Oct 25, 2007, at 9:58 AM, OnRails wrote: > > > > > class EverythingController < ApplicationController > > def index > > end > > > def findname > > content="here is test" > > render :text => content, :layout => false > > end > > .. > > end > > in other controller''s .rhtml, I used > > <%= render_component :controller => "everything", :action => > > "findname" %> > > > so, Do I need create a template _findname.rhtml for findname action? > > I don''t think I need it, because I just render content, not anything. > > but when I do function test, there is error: Misstemplate > > _findname.rhtml > > so I don''t understand this error. > > who can tell me why? and how can fix it, Thanks! > > Have a look at this article (and example code) which explains how to > use & combine views, partials, and layouts. > > http://gregwillits.wordpress.com/2007/10/16/modular-page-layouts-in- > ruby-on-rails/ > > -- gw--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
No you don''t need a view template if you are just rendering the text from an action. You also don''t need to specify :layout => false just write render :text => content On Oct 26, 12:59 am, OnRails <zzz...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> yes, I have looked this article. > but I just want to know If I used "render :text =>" to render > something view not whole page, Do I need create template? > > On Oct 25, 10:08 am, Greg Willits <li...-0Bv1hcaDFPRk211Z5VL+QA@public.gmane.org> wrote: > > > On Oct 25, 2007, at 9:58 AM, OnRails wrote: > > > > class EverythingController < ApplicationController > > > def index > > > end > > > > def findname > > > content="here is test" > > > render :text => content, :layout => false > > > end > > > .. > > > end > > > in other controller''s .rhtml, I used > > > <%= render_component :controller => "everything", :action => > > > "findname" %> > > > > so, Do I need create a template _findname.rhtml for findname action? > > > I don''t think I need it, because I just render content, not anything. > > > but when I do function test, there is error: Misstemplate > > > _findname.rhtml > > > so I don''t understand this error. > > > who can tell me why? and how can fix it, Thanks! > > > Have a look at this article (and example code) which explains how to > > use & combine views, partials, and layouts. > > >http://gregwillits.wordpress.com/2007/10/16/modular-page-layouts-in- > > ruby-on-rails/ > > > -- gw--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks! but I just write render :text => content when I do function test, there is Error. MissTemplate .... findname.rhtml so I am not sure where is wrong. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---