User has_one Subscription
In config/routes.rb:
resources :users do
member do
resource :subscription, controller: :subscription
end
end
I know that's probably wrong.
Form helper:
<%= simple_form_for [@user,@subscription] do |f| %>
But this format basically assumes a has_many
relationship instead, and I get this error:
ActionView::Template::Error (undefined method `user_subscriptions_path' for #<#<Class:0x007f8066709020>:0x007f8066717670>):
Then I try this, which is closer:
<%= simple_form_for @subscription, html: { id: "new_subscription", class: 'form-horizontal' }, defaults: { label_html: { style: "float:left;" } } do |f| %>
But the result is:
ActionView::Template::Error (undefined method `subscriptions_path' for #<#<Class:0x007f8066709020>:0x007f806d57de20>):
Thanks for any help you can offer.