Two questions:

* Have you tried using url(:articles_comments_ratings, 1)? I have not been
able to find the repro steps yet, but sometimes using the named route works
while using the resource route fails.

* To show or edit a rating, you should not need the nested route if the
ratings ID is unique. In this case, you could add the unnested ratings to
your route and use this instead.

..tony..

On Wed, Dec 3, 2008 at 11:58 AM, Martin Gamsjaeger <[EMAIL PROTECTED]>wrote:

>
> Hey all,
>
> I have my routes setup like so:
>
>  resources :articles do
>    resources :comments do
>      resources :ratings, :controller => "community/ratings"
>    end
>  end
>
> My ratings model is defined like
>
> module Community
>
>  class Rating
>
>    include DataMapper::Resource
>
>    property :id,         Serial
>    property :comment_id, Integer
>    property :rate,       Integer
>
>    belongs_to :comment
>
>  end
>
> end
>
> When I POST to /articles/1/comments/1/ratings it works fine, but then,
> when I want to redirect to
>
> /articles/1/comments/1/ratings/1
>
> using
>
> redirect @article, @comment, @rating
>
> and I get the following error:
>
>  ~ Resource route not found: [#<Article id=1 title="yo" body="snusnu"
> editor_id=nil>, #<Comment id=1 article_id=1 body="wassup">,
> #<Community::Rating id=1 comment_id=1 rate=1>] -
> (Merb::Router::GenerationError)
>
> If I don't nest the rating model, everything works fine!
>
> Any ideas?
>
> cheers
> snusnu
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to