teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

config/routes.rbのコードを追加しました。

2020/05/04 08:03

投稿

nosa
nosa

スコア1

title CHANGED
File without changes
body CHANGED
@@ -35,6 +35,22 @@
35
35
  posts POST / posts(.:format) posts#create
36
36
 
37
37
  ```
38
+ ### 該当のソースコード(config/routes.rb)
39
+
40
+ ```ここに言語名を入力
41
+ Rails.application.routes.draw do
42
+ devise_for :users
43
+ devise_scope :user do
44
+ get '/users/sign_out' => 'devise/sessions#destroy'
45
+ end
46
+ root to: 'posts#index'
47
+ resources :posts, only: [:create] do
48
+ get :search, on: :collection
49
+ resources :comments, only: [:create, :edit, :update]
50
+ end
51
+ end
52
+
53
+ ```
38
54
  ### 該当のソースコード(views/posts/search.html.haml 検索窓部抜粋)
39
55
 
40
56
  ```ここに言語名を入力