Should view related methods be included in models? class Submission &lt; ActiveRecord::Base

  def get_status_css()
    if self.status == IN_PROGRESS
      "info"
    elsif self.status == FAILED
      "error"
    elsif self.status == COMPLETED
      "success"
    else 
      "warning"
    end
  end

end


Submission is a model class and it has a method that returns css variables based on its status. Is this correct in the MVC architecture? I was thinking that since get_status_css is a method that is related to view, it shouldn't belong to a model class. Perhaps it should be put in the controller?
This could should not be in either the model or the view.  Rather is should be contained in the submission_helper, or if you really wanted to look into making it less procedural and more OO, then it should be handled by a presenter, a pattern in rails that steps in between the model and the view.

Jeff Casimir has developed a presenter for RoR called Draper (https://github.com/jcasimir/draper) which is definetly worth checking out, but in the mean time, the proper place for this is a helper method.

Its best to avoid logic in your view code, as its likely to change, and be distributed amongst many files, making it hard to maintain.  Putting it in a helper at least allows for a single source of that knowledge, so that if it has to change in the future it is easy to update. 

Hope this helps.