IMPROVED.
--
ROUTES
resources :appointments do
collection do
get 'history' => 'appointments#index'
end
end
--
CONTROLLER
def index
if request.request_uri==history_appointments_path
#past appointments
Got it, I think when I restarted the server, it didn't see the changes
or something.
ROUTES
resources :appointments do
collection do
get 'history' => 'appointments#index'
end
end
CONTROLLER
def index
if request.request_uri=='/appointments/history'
#past appointment
What you wanted to do could be achieved by routing:
http://guides.rubyonrails.org/routing.html#adding-more-restful-actions
HTH
On Sat, Oct 16, 2010 at 5:42 AM, Leonel *.* wrote:
> > If the history is
> > very like your index view then personally I would use a parameter on
> > the appointments
> 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.
This is what I
4 matches
Mail list logo