Rails初心者です。
VPSを構築して、インターネットへの公開を考えているのですが、
想定外のurlにアクセスした時に設定がデフォルトのままなので、
下記のようなエラーメッセージがでてプログラムが見えて危険なことになります。
これらのエラーメッセージ(赤い文字の)を表示させない方法を教えて頂きたくお願い
します。
Active Record エラー
ーーーーーーーーーーーーーーーーーーーーーーーーーーー
ActiveRecord::RecordNotFound in PostsController#show
Couldn't find Post with 'id'=neee
Extracted source (around line #15):
13
14
15
16
17
18
def show
@post=Post.find(params[:id])
end
def new
Rails.root: /home/xxxxxx/blog
Application Trace | Framework Trace | Full Trace
app/controllers/posts_controller.rb:15:in `show'
Request
Parameters:
{"id"=>"neee"}
Toggle session dump
Toggle env dump
ーーーーーーーーーーーーーーーーーーーーーーーーーーーー
routing error
No route matches [GET] "/posts/20/new"
Rails.root: /home/xxxxx/blog
Application Trace | Framework Trace | Full Trace
Routes
Routes match in priority from top to bottom
Helper
HTTP Verb
Path
Controller#Action
Path / Url
post_comments_path
GET
/posts/:post_id/comments(.:format)
comments#index
POST
/posts/:post_id/comments(.:format)
comments#create
new_post_comment_path
GET
/posts/:post_id/comments/new(.:format)
comments#new
・・・・・・・
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。