If the file app/views/sessions/new.coffee is present opening http://localhost:3000/home/index.js should redirect to sessions#new and use the js compiled from the coffee template.
Actual behavior
Tell us what happens instead
The html template is rendered instead the coffee template
This is the log output:
If the file app/views/sessions/new.coffee is present
Started GET "/home/index" for 127.0.0.1 at 2016-11-18 09:57:19 -0200
Processing by HomeController#index as JS
Redirected to http://localhost:3000/sessions/new
Started GET "/login" for 127.0.0.1 at 2016-11-18 09:57:20 -0200
Processing by SessionController#new as JS
Rendering admin/session/new.html.erb
Rendered admin/session/new.html.erb (5.2ms)
Completed 200 OK in 42ms (Views: 34.4ms | ActiveRecord: 0.0ms)
If the file app/views/sessions/new.js.erb is present
Started GET "/home/index" for 127.0.0.1 at 2016-11-18 09:41:34 -0200
Processing by HomeController#index as JS
Redirected to http://localhost:3000/sessions/new
Started GET "/login" for 127.0.0.1 at 2016-11-18 09:41:35 -0200
Processing by SessionController#new as JS
Rendering admin/session/new.js.erb
Rendered admin/session/new.js.erb (3659.3ms)
Completed 200 OK in 3846ms (Views: 3835.5ms | ActiveRecord: 0.0ms)
If the file app/views/sessions/new.coffee is present and the file app/views/sessions/new.html.erb is not present
Started GET "/home/index" for 127.0.0.1 at 2016-11-18 09:58:45 -0200
Processing by HomeController#index as JS
Redirected to http://localhost:3000/sessions/new
Started GET "/login" for 127.0.0.1 at 2016-11-18 09:58:45 -0200
Processing by SessionController#new as JS
Rendering admin/session/new.coffee
Rendered admin/session/new.coffee (636.9ms)
Completed 200 OK in 668ms (Views: 659.3ms | ActiveRecord: 0.0ms)
Steps to reproduce
rails new bug
rails generate controller sessions new
Sessions#new
.new.html.erb
,new.coffee
rails generate controller home index
redirect_to 'sessions/new'
rails s
sessions#new
using html templatesessions#new
using html templatenew.coffee
for the sessions view tonew.js.erb
.mv app/views/sessions/new.coffee app/views/sessions/new.js.erb
sessions#new
using html templatesessions#new
using js templateExpected behavior
If the file
app/views/sessions/new.coffee
is present opening http://localhost:3000/home/index.js should redirect tosessions#new
and use thejs
compiled from thecoffee
template.Actual behavior
Tell us what happens instead
The
html
template is rendered instead thecoffee
templateThis is the log output:
If the file
app/views/sessions/new.coffee
is presentIf the file
app/views/sessions/new.js.erb
is presentIf the file
app/views/sessions/new.coffee
is present and the fileapp/views/sessions/new.html.erb
is not presentSystem configuration
Rails version: Rails 5.0.0.1
Ruby version: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin16]
Gem list:
Additional Information
On my development machine, because I have a
new.html
with actual content this is the output when I open/login.js
Originally opened on rails/rails#27095