Re: Problem with RoR''s controller getting too large

Daniel N
Wed, 02 May 2007 04:58:35 -0000

On 5/2/07, shurain <shurain-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
>
>
> Let me rephrase the problem.
>
> I wish to be able to show an article using postcontroller.
> I would also like to create a comment using commentcontroller.
> I want to see them both in one view.


I''m not sure what the issue is.   Michael is correct when he says you
can
have as many controllers as you like.

If you want to see both a post and comment in one view use partials

eg something like (posts)

def show
  @post = Post.find_by_id( :id )
end

in your view

<%= display stuff for posts -%>

<%= render :partial => ''/comment/detail'', :collection
=> @post.comments %>

Is that along the lines of what your after?