Rails ExecJS :: Pages错误在页面#home?
启动一个新的应用程序,当我创建一个控制器页面回家并尝试转到本地主机:3000 / pages / home时,我收到以下错误:
Showing c:/Users/Doesha/desktop/pinplug/app/views/layouts/application.html.erb where line #6 raised:
TypeError: Object doesn't support this property or method
(in c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/turbolinks-2.5.3/lib/assets/javascripts/turbolinks.js.coffee)
application.html.erb文件:
<!DOCTYPE html>
<html>
<head>
<title>Pinplug</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>
application_controller.rb文件:
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end
pages_controller.rb文件:
class PagesController < ApplicationController
def home
end
end
routes.rb文件:
Rails.application.routes.draw do
get 'pages/home'
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
# root 'welcome#index'
# Example of regular route:
# get 'products/:id' => 'catalog#view'
# Example of named route that can be invoked with purchase_url(id: product.id)
# get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
# Example resource route (maps HTTP verbs to controller actions automatically):
# resources :products
# Example resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end
# Example resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end
Cats萌萌
相关分类