したがって、ユーザーが完全に登録し、そのオブジェクトをユーザーIDに接続したまま、レールでビルドメソッドを使用してオブジェクトを作成する方法を理解しようとして、この問題が発生しています。認証にdeviseを使用しており、作成する必要があるモデルは「アプリ」と呼ばれます。
「アプリ」の作成方法です。
def create
@app = App.new(app_params)
@app.id = current_user.id
respond_to do |format|
if @app.save
format.html { redirect_to @app, notice: 'Application successfully created.'}
else
format.html { render action: 'new' }
end
end
end
次のエラーが表示されます: ID=1 のアプリが見つかりませんでした
私のマルチステップフォームコントローラーから:
def show
@user = User.find(current_user)
case step
when :school, :grades, :extra_activity, :paragraph, :submit
@app = App.find(current_user)
end
render_wizard
end