Denny Mueller
Denny Mueller

Reputation: 3615

undefined local variable or method on link_to in rails

Thats the link_to

<%= link_to('Dashboard', dashboard_index) do %>
  <i class="icon-play"></i>
<% end %>

Thats the corresponding rake routes entry.

dashboard_index GET    /dashboard/index(.:format)     dashboard#index

What could be wrong? Any suggestion or idea?

thanks in advance best regards denym

Upvotes: 0

Views: 1706

Answers (1)

jameswilliamiii
jameswilliamiii

Reputation: 878

It should be

<%= link_to(dashboard_index_path) do %>
  Dashboard
  <i class="icon-play"></i>
<% end %>

Upvotes: 4

Related Questions