I am curious what folks do with the #show action (and its associated view) in a RESTful application. How often is it used? It seems to me that, for the sorts of applications I can envision, it probably wouldn''t be used much at all. Everything I might want to show can be displayed by the #index action. Is that true more or less often than not? If there isn''t anything to be gained by a #show action, what do folks do (if anything) to disable it? I have seen a use for #show in the classic case of a blog, where the index page shows the titles of each of the entries in the blog, but the user must click on one of those titles to "show" the actual blog post, but that brings up a related (and nearly identical) question... I can see the same issue with the #new action for a nested route. Again in the classic blog application, the #show action for the post would probably include a form for adding a comment, thus eliminating the need for a #new action (and its view) . What do you folks with vastly more RoR experience than I do in these situations? Is there a best practice? Is there a common practice? --wpd --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I use the show action to display specific forums and topics in rboard: http://github.com/radar/rboard . As for the new comment form, you don''t need to have all the 7 restful actions and if it makes more sense for your application to have a form for creating a new comment resource inside the page for a blog resource then that''s fine imo. ----- Ryan Bigg Freelancer http://frozenplague.net On 18/12/2008, at 1:52 PM, Patrick Doyle wrote:> I am curious what folks do with the #show action (and its associated > view) in a RESTful application. > > How often is it used? > > It seems to me that, for the sorts of applications I can envision, > it probably wouldn''t be used much at all. Everything I might want > to show can be displayed by the #index action. Is that true more or > less often than not? > > If there isn''t anything to be gained by a #show action, what do > folks do (if anything) to disable it? > > I have seen a use for #show in the classic case of a blog, where the > index page shows the titles of each of the entries in the blog, but > the user must click on one of those titles to "show" the actual blog > post, but that brings up a related (and nearly identical) question... > > I can see the same issue with the #new action for a nested route. > Again in the classic blog application, the #show action for the post > would probably include a form for adding a comment, thus eliminating > the need for a #new action (and its view) . > > What do you folks with vastly more RoR experience than I do in these > situations? Is there a best practice? Is there a common practice? > > --wpd > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Andrew Chronister
2008-Dec-18 04:26 UTC
Re: When to use #show action in RESTful application
I guess it''s all in the design... and the intent of the application... my users tend to stay in the show or edit views for the majority of their time... My show view has all the detailed information for the individual models that just get a name, a description and a few choice tidbits in the index view. From ''show'', the right nav "context" menu lets the users traverse the model relationships with a simple hyperlink click (Functional Requirement X is related to an Marketing Requirements Document, a Marketing Requirement, one or more Projects, one or more Applications, one or more Test Cases, one or more Scenarios, etc, etc, etc. Following relationships goes from show to show, and from a show, you can create or remove relationships to existing models, or create new models to be related from the context of the current model, generate PDFs, perform a traceability analysis, etc. There is a top nav which lets you get to any index view if you want to navigate to a model "outside" the current context (i.e., not related to the model you''re currently looking at). -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Right after I clicked "Send", I thought to myself, Hmmm.... I wonder if map.resources has a :only or :exclude options. Sure enough, it does. That answers my original question of "what should I do with the #show or #edit" actions if I don''t see a need for them in my application?" -- I can exclude the routes from being generated for them. Andrew, I would love to see your application in action -- is it open source, or, at least running on the web somewhere? --wpd --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
It''s a company intranet app, but if you send me (arc-+CaMrajDnO5BDgjK7y7TUQ@public.gmane.org) your email, I''ll send some screenshots as examples. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hassan Schroeder
2008-Dec-18 15:50 UTC
Re: When to use #show action in RESTful application
On Wed, Dec 17, 2008 at 7:22 PM, Patrick Doyle <wpdster-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am curious what folks do with the #show action (and its associated view) > in a RESTful application. > > How often is it used?? I''ve never done (or even imagined) an app that doesn''t use it.> It seems to me that, for the sorts of applications I can envision, it > probably wouldn''t be used much at all. Everything I might want to show can > be displayed by the #index action. Is that true more or less often than > not?Typically, the index page lists multiple instances of a thing (model) -- people, groups, bikes, t-shirts -- with links to ''show'' you a detail view of a single instance of that model. That''s a classic web design pattern, regardless of platform. FWIW, -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey Patrick, I understand the index action to list the resources and the show action to display a specific resource. This way I normally use both actions... Cheers, Sazima On Dec 18, 1:22 am, "Patrick Doyle" <wpds...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am curious what folks do with the #show action (and its associated view) > in a RESTful application. > > How often is it used? > > It seems to me that, for the sorts of applications I can envision, it > probably wouldn''t be used much at all. Everything I might want to show can > be displayed by the #index action. Is that true more or less often than > not? > > If there isn''t anything to be gained by a #show action, what do folks do (if > anything) to disable it? > > I have seen a use for #show in the classic case of a blog, where the index > page shows the titles of each of the entries in the blog, but the user must > click on one of those titles to "show" the actual blog post, but that brings > up a related (and nearly identical) question... > > I can see the same issue with the #new action for a nested route. Again in > the classic blog application, the #show action for the post would probably > include a form for adding a comment, thus eliminating the need for a #new > action (and its view) . > > What do you folks with vastly more RoR experience than I do in these > situations? Is there a best practice? Is there a common practice? > > --wpd--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
For my admin pages, I always use the edit action instead of show. It cuts down on the amount of work and I find it more useful that way. Hey Ryan, do you have any live rboards up on the web? I''d love to see it in action... On Dec 17, 7:22 pm, "Patrick Doyle" <wpds...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am curious what folks do with the #show action (and its associated view) > in a RESTful application. > > How often is it used? > > It seems to me that, for the sorts of applications I can envision, it > probably wouldn''t be used much at all. Everything I might want to show can > be displayed by the #index action. Is that true more or less often than > not? > > If there isn''t anything to be gained by a #show action, what do folks do (if > anything) to disable it? > > I have seen a use for #show in the classic case of a blog, where the index > page shows the titles of each of the entries in the blog, but the user must > click on one of those titles to "show" the actual blog post, but that brings > up a related (and nearly identical) question... > > I can see the same issue with the #new action for a nested route. Again in > the classic blog application, the #show action for the post would probably > include a form for adding a comment, thus eliminating the need for a #new > action (and its view) . > > What do you folks with vastly more RoR experience than I do in these > situations? Is there a best practice? Is there a common practice? > > --wpd--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rboard can be found at http://gitpilot.co ----- Ryan Bigg Freelancer http://frozenplague.net On 20/12/2008, at 11:40 AM, jasoo24 wrote:> > For my admin pages, I always use the edit action instead of show. It > cuts down on the amount of work and I find it more useful that way. > > Hey Ryan, do you have any live rboards up on the web? I''d love to see > it in action... > > On Dec 17, 7:22 pm, "Patrick Doyle" <wpds...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> I am curious what folks do with the #show action (and its >> associated view) >> in a RESTful application. >> >> How often is it used? >> >> It seems to me that, for the sorts of applications I can envision, it >> probably wouldn''t be used much at all. Everything I might want to >> show can >> be displayed by the #index action. Is that true more or less often >> than >> not? >> >> If there isn''t anything to be gained by a #show action, what do >> folks do (if >> anything) to disable it? >> >> I have seen a use for #show in the classic case of a blog, where >> the index >> page shows the titles of each of the entries in the blog, but the >> user must >> click on one of those titles to "show" the actual blog post, but >> that brings >> up a related (and nearly identical) question... >> >> I can see the same issue with the #new action for a nested route. >> Again in >> the classic blog application, the #show action for the post would >> probably >> include a form for adding a comment, thus eliminating the need for >> a #new >> action (and its view) . >> >> What do you folks with vastly more RoR experience than I do in these >> situations? Is there a best practice? Is there a common practice? >> >> --wpd > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Very cool. Thank you, I will watch for updates! On Dec 19, 6:17 pm, Ryan Bigg <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Rboard can be found athttp://gitpilot.co > ----- > Ryan Bigg > Freelancerhttp://frozenplague.net > > On 20/12/2008, at 11:40 AM, jasoo24 wrote: > > > > > For my admin pages, I always use the edit action instead of show. It > > cuts down on the amount of work and I find it more useful that way. > > > Hey Ryan, do you have any live rboards up on the web? I''d love to see > > it in action... > > > On Dec 17, 7:22 pm, "Patrick Doyle" <wpds...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> I am curious what folks do with the #show action (and its > >> associated view) > >> in a RESTful application. > > >> How often is it used? > > >> It seems to me that, for the sorts of applications I can envision, it > >> probably wouldn''t be used much at all. Everything I might want to > >> show can > >> be displayed by the #index action. Is that true more or less often > >> than > >> not? > > >> If there isn''t anything to be gained by a #show action, what do > >> folks do (if > >> anything) to disable it? > > >> I have seen a use for #show in the classic case of a blog, where > >> the index > >> page shows the titles of each of the entries in the blog, but the > >> user must > >> click on one of those titles to "show" the actual blog post, but > >> that brings > >> up a related (and nearly identical) question... > > >> I can see the same issue with the #new action for a nested route. > >> Again in > >> the classic blog application, the #show action for the post would > >> probably > >> include a form for adding a comment, thus eliminating the need for > >> a #new > >> action (and its view) . > > >> What do you folks with vastly more RoR experience than I do in these > >> situations? Is there a best practice? Is there a common practice? > > >> --wpd--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---