So here’s what I do and lets see if someone can solve the problems
rails test
cd test
script/generate scaffold Task body:string completed:boolean
rake db:create
rake db:migrate
#routes.rb
map.resources :tasks, :member => {:complete => :post}
map.connect ‘:controller/:action/:id’
map.connect ‘:controller/:action/:id.:format’
#tasks_controller.rb
def complete
@task = Task.find(params[:id])
@task.completed = true
end
#index.html.erb
script/server
Now, add a task then go back to index
Click the Complete link and watch it go:
Unknown action
No action responded to 1
And here’s what it’s doing in the log:
Parameters: {“action”=>“1”, “id”=>“complete”, “controller”=>“tasks”}
Why isn’t it recognizing it as action => complete, id => 1 ?
I can reproduce this every time so there’s nothing I’m doing that
might trigger something like this.