web-console을 사용하면 Rails App의 디버깅이 쉬워집니다.
View 내에서 콘솔을 시작하여 변수나 parameter 등의 상태를 볼 수 있는 디버그용 라이브러리.
Rails 4.2부터 기본적으로 들어있었네요. 이런 편리한 디버그 툴을 몰랐다니 손해했다. . .
사용법
콘솔을 시작하려는 View 또는 Controller에서 console
메서드 호출
보기<% console %>
<p id="notice"><%= notice %></p>
<h1>Listing Users</h1>
...
controllerclass UsersController < ApplicationController
before_action :set_user, only: [:show, :edit, :update, :destroy]
# GET /users
# GET /users.json
def index
console
@users = User.all
end
...
이것만으로, 아래와 같은 콘솔이 일어납니다!

그런 다음 Rails Console과 마찬가지로보고 싶은 정보를 입력하십시오!

편리하다!
덧붙여서, 에러 페이지에서는 아무것도 설정하지 않아도 자동으로 일어나게 됩니다. 변수의 값이라든지 보고 싶은 것만이라면 pry
따로 묻을 필요 없었군요-.
Reference
이 문제에 관하여(web-console을 사용하면 Rails App의 디버깅이 쉬워집니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/pekepek/items/74c8b1f4c886fc9b15cd
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
<% console %>
<p id="notice"><%= notice %></p>
<h1>Listing Users</h1>
...
class UsersController < ApplicationController
before_action :set_user, only: [:show, :edit, :update, :destroy]
# GET /users
# GET /users.json
def index
console
@users = User.all
end
...
Reference
이 문제에 관하여(web-console을 사용하면 Rails App의 디버깅이 쉬워집니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/pekepek/items/74c8b1f4c886fc9b15cd텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)