firstdraft / draft_generators

Rails generators that help beginners learn to program.
MIT License
2 stars 3 forks source link

Fix missing 'the' in generated delete link #97

Closed jelaniwoods closed 4 years ago

jelaniwoods commented 4 years ago

Somehow the update from https://github.com/firstdraft/draft_generators/blob/1b26414951e51b4e1d45307eea5bc2745b4fb594/lib/generators/draft/resource/templates/views/show.html.erb#L31 didn't make it in to this branch, which causes errors on the generated show page.

Also the changes from https://github.com/firstdraft/draft_generators/blob/pm-summer-2020-query-style/lib/generators/draft/resource/templates/views/show.html.erb don't seem to be included somehow?

This change fixes it.

Add to Gemfile

gem 'draft_generators', github: 'firstdraft/draft_generators', branch: 'jw-fix-missing-the'

then bundle install

rails g draft:resource photo image:string caption:text && rails db:migrate

Then rails s and visit /photos to create a photo and finally visit /photos/1 and try editing and deleting without errors.

My test snapshot Open in Gitpod

raghubetina commented 4 years ago

LGTM