При попытке создать новый ресурс с помощью типичных форм рельсов я получаю undefined method stripe_managed_accounts_path
. Ниже мой код, я ошарашен, не могу понять.Odd Rails Routing erros
Контроллер
class StripeManagedAccountsController < ApplicationController
before_action :authenticate_printer!
def new
@stripe_managed_account = StripeManagedAccount.new(printer_id: current_printer.id)
end
end
модель
class StripeManagedAccount < ActiveRecord::Base
belongs_to :printer
end
просмотров/новые
<h1>Create New Stripe Managed Account</h1>
<%= render 'form' %>
вид/форма
<h5>inside the form</h5>
<%= form_for @stripe_managed_account do |f| %>
<% end %>
маршруты
resources :printers, only: [:show, :edit, :update] do
resources :stripe_managed_accounts
end
ошибка
`undefined method 'stripe_managed_accounts_path' for #<#<Class:0x007fc627d342b8>:0x007fc62b36e108>`
маршруты
printer_stripe_managed_accounts GET /printers/:printer_id/stripe_managed_accounts(.:format) stripe_managed_accounts#index
POST /printers/:printer_id/stripe_managed_accounts(.:format) stripe_managed_accounts#create
new_printer_stripe_managed_account GET /printers/:printer_id/stripe_managed_accounts/new(.:format) stripe_managed_accounts#new
edit_printer_stripe_managed_account GET /printers/:printer_id/stripe_managed_accounts/:id/edit(.:format) stripe_managed_accounts#edit
printer_stripe_managed_account GET /printers/:printer_id/stripe_managed_accounts/:id(.:format) stripe_managed_accounts#show
PATCH /printers/:printer_id/stripe_managed_accounts/:id(.:format) stripe_managed_accounts#update
PUT /printers/:printer_id/stripe_managed_accounts/:id(.:format) stripe_managed_accounts#update
DELETE /printers/:printer_id/stripe_managed_accounts/:id(.:format) stripe_managed_accounts#destroy
и он highliting эту линию <%= form_for @stripe_managed_account do |f| %>
Я grepped весь базовый код для stripe_managed_accounts_path
и не где , Я в конце концов шансов ...
UPDATE :::
Если добавить этот маршрут он исчезает ??? Почему он ищет этот маршрут. Это из-за того, как я назвал свои кормушки и т. Д.?
обеспечивают грабли: маршруты, это может быть ключом –
Я. может быть, это будет – Seal
это интересно '# <# <Класс: 0x007fc627d342b8>: 0x007fc62b36e108>' – Seal