On Mon, Apr 18, 2011 at 10:47 AM, Matt Harrison <
[email protected]> wrote:

> On Mon, Apr 18, 2011 at 07:51:49AM -0500, Bryan Crossland wrote:
> > On Sun, Apr 17, 2011 at 5:01 PM, Matt Harrison <
> [email protected]
> > > wrote:
> >
> > >
> > > I can post full code examples if necessary.
> > >
> > >
> > That would be extremely helpful.
>
> Ok, here is the controller code:
>
> http://pastie.org/1807523
>
> And the views:
>
> http://pastie.org/1807530
>
> And the partial:
>
> http://pastie.org/1807536
>
>
> new/update works perfectly, while edit/update gives this error while
> visiting the edit
> action:
>
> http://pastie.org/1807548
>
>
> If I change the edit view to look like the following, it works fine:
>
> http://pastie.org/1807558
>
> But I don't want to have to do that for every view. As you can tell I'm no
> expert and
> I'm a bit stumped. Grateful for some tips
>
> Thanks
>


I think the issue is that you need to remove :partial=> from your Edit
Category view. When you are specifying :partial hash param it is ignoring
:target and expecting something else, like collection, to be passed in. If
you change your Edit to be like what is below it should work.

Change from this:

 = render :partial => "shared/error_messages", :target => @category

To this:

 = render "shared/error_messages", :target => @category

B.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to