Reputation: 2597
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>
Upvotes: 0
Views: 90
Reputation: 17834
It should be new_recurring_income_path
Check spelling of recurring
in new_reccuring_income_path
Upvotes: 1
Reputation: 33542
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>
Upvotes: 3