Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with resources controller on destroy #1

Open
cpjobling opened this issue May 20, 2009 · 0 comments
Open

Problem with resources controller on destroy #1

cpjobling opened this issue May 20, 2009 · 0 comments

Comments

@cpjobling
Copy link

Rails 2.3.2.

I created a new project. Installed the resources_controller plugin. Generated scaffold for a model:

ruby script\generate scoffold projects title:string description:text resources:text created_by:integer.

Edited projects_controller to remove rails generated scaffolding, and make it:

class ProjectsController < ApplicationController
resources_controller_for :projects
end

Then ran rake test

Functional test (generated by scaffold) fails on should_destroy.

Redirect should be to

test_should_destroy_project(ProjectsControllerTest):
Expected response to be a redirect to http://test.host/projects but was a redirect to http://test.host/projects.%23%3Cproject:0x54c11fc%3E.

It looks like a bug: .%23%3Cproject:0x54c11fc%3E is an object where an empty string was expected. But maybe I missed something in the configuration.

Routes file looks normal enough:

(in D:/InstantRails-2.0-win/rails_apps/test-rc)
projects GET /projects(.:format) {:controller=>"projects", :action=>"index"}
POST /projects(.:format) {:controller=>"projects", :action=>"create"}
new_project GET /projects/new(.:format) {:controller=>"projects", :action=>"new"}
edit_project GET /projects/:id/edit(.:format) {:controller=>"projects", :action=>"edit"}
project GET /projects/:id(.:format) {:controller=>"projects", :action=>"show"}
PUT /projects/:id(.:format) {:controller=>"projects", :action=>"update"}
DELETE /projects/:id(.:format) {:controller=>"projects", :action=>"destroy"}
/:controller/:action/:id
/:controller/:action/:id(.:format)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant