Topic: Form_for? Should I use this for my SHOW as well as (new and edit)?

I'm getting ready to start 'cranking out' many Rails applications and am trying to decide a standard approach for building VIEW's.
I see in many example how the Form_For is the recommended way to paint a datacentric view that serves one table. Should I use this approach for my SHOW .rhtml's along with my edit and new's?
Thank you.
David

Re: Form_for? Should I use this for my SHOW as well as (new and edit)?

form_for is for creating forms - do you have a form in your show.rhtml file? If so, what does it do?

Railscasts - Free Ruby on Rails Screencasts

Re: Form_for? Should I use this for my SHOW as well as (new and edit)?

Ryan, Everything I write will be a RESTful business application that typically performs all 7 of the RESTful functions. I've observed in example applications that many use the same 'form_for' based _form partial for showing BOTH their edit and new view templates. My question is: should I use this same technique for my SHOW's and simply not have a SUBMIT button on the bottom.
David

Re: Form_for? Should I use this for my SHOW as well as (new and edit)?

form_for is only meant for data entry. In a RESTful app you will only see it on the new and edit actions.

Show and Index actions do not typically have inputs..they just display your DB info.

You are very encouraged to use partials in all your templates whenever duplication pops up, however.

Last edited by pimpmaster (2007-05-09 18:45:33)