Вопрос

I have model RecurringIncome

I set routes:

resources :recurring_incomes

I check routes with rake routes and I see:

 new_recurring_income GET      /recurring_incomes/new(.:format)      recurring_incomes#new

But:

new_recurring_income_path

give an error:

undefined local variable or method `new_reccuring_income_path'

What's wrong?

html in income/new.html.erb:

    <div class='section_button'><i class="fa fa-plus-square"></i><%= link_to 'Add icome', new_reccuring_income_path %></div>
Это было полезно?

Решение

You have a typo .It should be new_recurring_income_path

you have set resources :recurring_incomes and you are using new_reccuring_income_path.

update your link_to as

<div class='section_button'><i class="fa fa-plus-square"></i><%= link_to 'Add icome', new_recurring_income_path %></div>

Другие советы

It should be new_recurring_income_path

Check spelling of recurring in new_reccuring_income_path

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top