Topic: design question

Hi folks! I'm new to rails.
I have some trouble with the following:
I have a Pacient(model), that I'll be following in time, through a protocol(Pacient's attribute), depending on his pathology: diabetes/dialysis/../ with blood test and what not. In the Pacient view I want to make a link: addvisit, that will take me to the form corresponding protocol.
Where should I put the logic for that? controller? model?

Re: design question

In order to answer your question, Cuciferus, we really need to see more of your code, I think.  I can tell you that ALL links go in your "views."  But it is not even that simple.  You also need to have a corresponding route in your routes.rb to tell rails what the link does. 

Good Luck

I'm so abstract that automatic doors at grocery stores do not even open for me. - @thatdankent

Re: design question

Maybe my English is not that good because I thought this as a simple question.
So these are my models:

class Centru < ActiveRecord::Base
  belongs_to :protocol
end
class Diabet < ActiveRecord::Base
  belongs_to :pacient
end
class Hemodializa < ActiveRecord::Base
  belongs_to :pacient
end
class Pacient < ActiveRecord::Base
  has_many :protocols
  has_many :diabets, :through => :protocols
  has_many :hemodializas, :through => :protocols
  accepts_nested_attributes_for :protocols, :allow_destroy => true
end
class Protocol < ActiveRecord::Base
  belongs_to :pacient
  CENTRE = [
    ['Sibiu', 's'],
    ['Bucuresti semanatoarea','sema'],
    ['Bucuresti industriilor','industriilor'],
    ['Ordoheiu Secuiesc','ordohei'],
    ['Targu jiu','tgjiu'],
    ['Bistrita','bistrita'],
    ['Miercurea Ciuc','mciuc']
  ]
  PROGRAME = [
    ['Hemodializa', 'hd'],
    ['Dializa Peritoneala','capd'],
    ['Diabet', dz']
    ]

  validates_inclusion_of :centru, :in =>
    CENTRE.map {|disp, value| value}
  validates_inclusion_of :program, :in =>
    PROGRAME.map {|disp, value| value}
end

and routes:ProiectConf::Application.routes.draw do



#deeply nested nu e recomandat incercam altfel

  resources :pacients do
    resources :protocols
    resources :diabets
    resources :hemodializas
  end

  resources :protocols
  resources :diabets
  resources :hemodializas

end


What I want to do here si add a link in pacient/edit view named: add visit, that will redirect the user to the add view of diabets/hemodializas based on the attribute of the Pacient.
Thanks!