I created a new scaffold rails generate scaffold scores score:integer route_id:integer
and ran rake db:migrate
.
This works well, but when I go to the scores page to delete some data the delete link somehow displays the view details, but doesn't delete it. I also compared the link with some other projects and it looks pretty much the same only that it doesn't work this time.
That's what I have in my index.html.erb page:
<td><%= link_to 'Destroy', score, method: :delete, data: { confirm: 'Are you sure?' } %></td>
I found in some posts on this site that the gem file needs to contain gem 'jquery-rails'
so I checked and it is there. I also ran bundle install
again, but no change.
The change from link_to
to button_to
didn't help either.
Does anybody have an idea what else it could be? If you need more details let me know and I will be happy to add it.
Many thanks.