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

質問編集履歴

1

表記の修正

2019/11/20 05:21

投稿

onigiri_beef
onigiri_beef

スコア6

title CHANGED
File without changes
body CHANGED
@@ -1,3 +1,5 @@
1
+ ### 前提・実現したいこと
2
+
1
3
  ruby on rails でサービス開発をしております。deviseを用いて新規会員登録、ログイン機能などを実装していたのですが、今回新たに新規会員登録と決済を同時に行うページを作成したいと思っています。
2
4
  現在
3
5
  ``app/views/device/registrations/new.html``
@@ -8,7 +10,20 @@
8
10
 
9
11
 
10
12
 
13
+ ### 発生している問題・エラーメッセージ
14
+ ``app/views/device/registrations/new_with_payment.html``を``localhowt:3000``で立ち上げると
15
+ ```ruby
16
+ = form_for(resource, as: resource_name, url: create_with_payment_path(resource_name)),do |f|
17
+ ```
18
+ ここで``First argument in form cannot contain nil or be empty``というエラーが出てしまいます。
19
+
20
+
21
+ viewに関しては[こちらを参考](https://github.com/plataformatec/devise/blob/master/app/views/devise/registrations/new.html.erb)に記述しており、``app/views/device/registrations/new.html``の時は特に問題なく動いておりました。
22
+
23
+
24
+ ### 試したこと
25
+
11
- また、ルーティングには
26
+ ルーティングには
12
27
  ```ruby
13
28
 
14
29
  devise_for :users, controllers: {
@@ -24,16 +39,9 @@
24
39
  ```
25
40
 
26
41
  を追加しております。
27
- viewに関しては[こちらを参考](https://github.com/plataformatec/devise/blob/master/app/views/devise/registrations/new.html.erb)に記述しております。
28
42
 
29
- ``app/views/device/registrations/new.html``の時は特に問題がなかったのですが、``app/views/device/registrations/new_with_payment.html``
30
- を``localhowt:3000``で立ち上げると
31
- ```ruby
32
- = form_for(resource, as: resource_name, url: create_with_payment_path(resource_name)),do |f|
33
- ```
34
- ここで``First argument in form cannot contain nil or be empty``というエラーが出てしまいます。
35
43
 
36
- 何か引数を渡してあげないといけないのかと思うのですが、今までは``app/views/device/registrations/new.html``のviewで特に問題なく動いていたので(引数を渡すような記述もしていない)なぜエラーが出るか困っています。
44
+ エラーの内容的に何か引数を渡してあげないといけないのかと思うのですが、今までは``app/views/device/registrations/new.html``のviewで特に問題なく動いていたので(引数を渡すような記述もしていない)なぜエラーが出るか困っています。
37
45
 
38
46
  rails初心者で基礎的な内容でしたら申し訳ありませんがご教授いただけますと幸いです。
39
47
  何卒よろしくお願いいたします。