How can i fetch in a model a method that would return the value of a specific model.
The code is has follow
Model Article
def article_title(id)
art = Article.find_by_id(id)
return art.title
end
The view is as follow
<% arttitle = Article.article_title(id) %>
This doesn’t work but i am not sure what the way to do it
The method should be defined as a class method, with
selfkeyword