Hi, everyone, I just want to know if I created a action in controller, I must have need one view for this action? except render :nothing=>true. --~--~---------~--~----~------------~-------~--~----~ 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 for every action. Neither do you need an action for every view. If you want to see this in action, just create a resource will scaffold_resource generator. index, show, new, edit all have views while, create, update, and destroy do not. This is because the either redirect to another view, or render another action. Also, lets say you have a controller called main, and in the main views folder, you had a file called index.rhtml. If the markup in index.rhtml is all static, then you don''t even need an action for index in the "main" controller. On Oct 27, 2007, at 5:45 PM, OnRails wrote:> > Hi, everyone, I just want to know if I created a action in controller, > I must have need one view for this action? > except render :nothing=>true. > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> > Also, lets say you have a controller called main, and in the main > views folder, you had a file called index.rhtml. If the markup in > index.rhtml is all static, then you don''t even need an action for > index in the "main" controller.This view doesn''t need to be static either. It could use variables defined in before filters, methods in helpers, etc. Not a big deal, just a little clarification. -Bill Matthew Swasey wrote:> No, you don''t need a view for every action. Neither do you need an > action for every view. > > If you want to see this in action, just create a resource will > scaffold_resource generator. index, show, new, edit all have views > while, create, update, and destroy do not. This is because the either > redirect to another view, or render another action. > > Also, lets say you have a controller called main, and in the main > views folder, you had a file called index.rhtml. If the markup in > index.rhtml is all static, then you don''t even need an action for > index in the "main" controller. > > > On Oct 27, 2007, at 5:45 PM, OnRails wrote: > > >> Hi, everyone, I just want to know if I created a action in controller, >> I must have need one view for this action? >> except render :nothing=>true. >> >> >> > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---