Possible bug in redirect_to

I have in my controller

redirect_to :action => ‘edit’, :id => @controller

This works find when using the site: ‘/projects/edit/1’

However, when this code is hit froim a functinoal test, it produces: “/projects/edit/#Account:0xa74a5ba8

has anyone else run into this?

mark

I'm not sure why this happens, but you can fix it by passing id @controller.id instead of @controller

Is @controller a model object? It's probably not a good idea to name your instance var @controller. Try something else, like @project

-- tim

Is @controller a model object? It’s probably not a good idea to name your instance var @controller. Try something else, like @project

In the real code it is @project, not @controller.

mark

Mark Van Holstyn wrote:

In the real code it is @project, not @controller.

When you show someone a sample of code that is failing, you should always show them *real* code. Doing otherwise merely confuses those that are trying to help.

Furthermore, this sounds like a support question. Did you make an effort to ask on the talk mailing list or on irc? Further replies to this thread should probably be made to the rubyonrails-talk list.

On your actual issue, does your model descend from AR::B? If not then you must define to_param to return the string url encoding for your model.