rubyonjets/jets

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

Closed this issue · 1 comments

Checklist

  • Upgrade Jets: Are you using the latest version of Jets? This allows Jets to fix issues fast. There's a jets upgrade command that makes this a simple task. There's also an Upgrading Guide: http://rubyonjets.com/docs/upgrading/
  • Reproducibility: Are you reporting a bug others will be able to reproduce and not asking a question. If you're unsure or want to ask a question, do so on https://community.rubyonjets.com
  • Code sample: Have you put together a code sample to reproduce the issue and make it available? Code samples help speed up fixes dramatically. If it's an easily reproducible issue, then code samples are not needed. If you're unsure, please include a code sample.

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 :_(

Handled in #522

Note for posterity: 3bb09f4