Howto change @article.article.headline to @article.headline

I have to actions:

def index
@articles = Article.find(:all,
:conditions => “un_published != ‘1’”,
:order => “created_on desc”)


def group
id = params[:id]
@articles = ArticleGroup.find(:all,
:include => [:group, :article],
:conditions => [“articles.un_published != ‘1’ and =
?”, id],
:order => “articles.created_on desc”)
render :action => ‘index’

The last one will not work off course, because in the index.rhtml view
I get the stuff from the array with @article.headline,
@article.ingress etc. and in the group action I have to use
@article.article.headline etc. I really don’t want to write another
view just because of this difference.

How can I avoid it?

Henrik Ormåsen

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs