Friday, October 15, 2010

Re: [Rails] Appointment History template page

On 15 October 2010 16:50, Leonel *.* <lists@ruby-forum.com> wrote:
> Ok so I got an Appointments page (index.html.erb)
>
> How would I go about adding an Appointment History page?
>
> 1) adding a history.html.erb and editing my routes?

I presume you mean adding a history controller

>
> or
>
> 2) use some kind of get parameter (e.g. /appointments/history) and
> adding it to the appointments controller (eg def history )?

Either is ok, do it whichever way you think is most appropriate. One
thing to consider is what the views will be like. If the history is
very like your index view then personally I would use a parameter on
the appointments controller that just causes the appropriate records
to be selected. If you think of the history view as being completely
different then do it with it's own controller.

Either way make sure you write your tests first so that if you decide
later that you prefer the other way then you can be confident that you
have re-factored the code correctly when all the tests pass.

Colin

--
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@googlegroups.com.
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate