-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
プランナー新規登録機能と画面の追加 #10
Conversation
app/assets/stylesheets/planners.scss
Outdated
@@ -0,0 +1,3 @@ | |||
// Place all the styles related to the Planners controller here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使ってないのであれば消しましょう!
必要なとに作成すればいいので
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これは、ファイルごと消しちゃって良い感じですかね?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
@@ -0,0 +1,12 @@ | |||
require 'rails_helper' | |||
|
|||
RSpec.describe "Planners", type: :request do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Planners"でなく以下のようにしておきましょうか😃
RSpec.describe PlannersController, type: :request do
|
||
RSpec.describe "Planners", type: :request do | ||
|
||
describe "GET /new" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe 'GET /planner/new' do にして、
it { is_expected.to eq 200 }
とかだけの方がシンプルかなと思いました😃
expect(response).to have_http_status(:success) | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここは空行いらないです。
後、POST のテストがないので、追加してください!
ちゃんと想定通りのデータが作られているかのテストが一番重要なので✏️
config/routes.rb
Outdated
@@ -1,3 +1,4 @@ | |||
Rails.application.routes.draw do | |||
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html | |||
root 'planners#new' | |||
resources :planners |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
基本的に、必要なアクションだけに絞り込むために、onlyオプションをつけておきましょう😃
全アクション使う予定です???
であれば以下
resources :planners, only: %i(index new create show edit update destroy)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resources じゃなくて resource の方が良さそう。
というのもパスにidが不要になるので、他のプランナーの編集画面などに悪意のある人が入り込んだり、とかゆうのが防げた気がします。笑
色々と調べてみてください✏️
https://qiita.com/ryuuuuuuuuuu/items/e5960c7fecad4ef1301b
後、画面など作成した場合は、画面のキャプチャを一番上の説明のところに貼っておいてください😊 |
app/javascript/packs/application.js
Outdated
require("@rails/ujs").start() | ||
require("turbolinks").start() | ||
require("@rails/activestorage").start() | ||
require("channels") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
空行が
</head> | ||
|
||
<body> | ||
<%= yield %> | ||
</body> | ||
</html> | ||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
空行が.....
| "> | ||
= value | ||
body | ||
= yield |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
空行が...........
- flash.each do |key, value| | ||
| <p class="alert alert- | ||
= key | ||
| "> | ||
= value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このフラッシュメッセージはヘッダーに表示させちゃって良いのかな??
他、ログインボタンとかヘッダーに表示させないなら良さそうだけど、
Matching Financial Plannerとかとかぶらないのかな🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Zuck3-r
指摘しました😃
post planners_new_path, params: planner | ||
expect(response).to redirect_to root_url | ||
describe 'POST /planners'do | ||
context 'param is correct' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
パラメーターが不正なときのspecも書いてもらって良いですか??
やり方や、意味がわからなかったら聞いてください♪ |
@Zuck3-r |
@Zuck3-r |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
以下のコミットの積み方に関しては、まだ修正されてないみたいだけど、
内容的には良さそうです!
#10 (comment)
aa79e44
to
fd5a2c2
Compare
fd5a2c2
to
5a50a4c
Compare
@MurakiSari |
プランナーの新規登録画面と、機能の実装