rubyonjets / jets

Ruby on Jets
http://rubyonjets.com
MIT License
2.6k stars 181 forks source link

When the controller name is singular, the behavior of searching for the View file is different from expected. #454

Closed rhiroe closed 3 years ago

rhiroe commented 4 years ago

Checklist

My Environment

Software Version
Operating System Mac OS X 10.14.6
Jets 2.3.13
Ruby 2.5.3

Expected Behaviour

$ jets g controller sample show
      create  app/controllers/sample_controller.rb
       route  get 'sample/show'
      invoke  erb
      create    app/views/sample
      create    app/views/sample/show.html.erb
      invoke  helper
      create    app/helpers/sample_helper.rb

$ jets server

Access http://localhost:8888/sample/show => The page renders successfully.

Current Behavior

$ jets g controller sample show
      create  app/controllers/sample_controller.rb
       route  get 'sample/show'
      invoke  erb
      create    app/views/sample
      create    app/views/sample/show.html.erb
      invoke  helper
      create    app/helpers/sample_helper.rb

$ jets server

Access http://localhost:8888/sample/show => ActionView::MissingTemplate: Missing template samples/show

For Rails, this works. Is this a specification for Jets?

Step-by-step reproduction instructions

Code Sample

Solution Suggestion

Modify the logic to look for View files. ... But I don't know where it is :_(

tongueroo commented 3 years ago

Handled in #522

Note for posterity: https://github.com/boltops-tools/jets/commit/3bb09f48f3935b9e31d9c860cdda684871e5f8d6