Please disregard this question, I figured it out. The error message was
giving me very little information, so I incorrectly thought the issue was in
the controller when it was in the view and was simple to fix once I figured
out where it was.


On Wed, Oct 20, 2010 at 12:35 PM, Chris P <[email protected]> wrote:

> I have set up nested routing for a project I'm working on. The routing
> config file looks like this:
>
> resources :projects do
>    resources :key_questions
> end
>
> I have this working for other aspects of my site just fine, and
> actually have no problems at all except for when I'm trying to destroy
> a key_question entry.
>
> Here is my destroy method of the key_questions controller:
> def destroy
>    @key_question = KeyQuestion.find(params[:id])
>    @key_question.destroy
>
>    respond_to do |format|
>      format.html
> { redirect_to( project_key_questions_path(session[:project_id]) )}
>      format.xml  { head :ok }
>    end
> end
>
> I use the same redirection for other links on the site and they work
> fine, but when calling the destroy action I get the error:
> No route matches "/projects/53/key_questions"
>
> If I then move my cursor to the URL bar and push enter, it loads that
> same page just fine without a routing error. What is going on here???
> I should also note that the database entry is not being removed.
>
> My Config:
> Rails 3.0, Ruby 1.9.2
>
> Thank you so much to anyone who can offer some advice!
>
> - Chris
>
>

-- 
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