nas
nas

Reputation: 2417

template missing error on link click

These are my: index.html.erb <%= link_to 'Assign Role', projects_assign_role_path(project) %>

controller file def assign_role @users = User.where.not(id: 1) end

routes

get "projects/:id/assign_role" => "projects#assign_role", as: :projects_assign_role

But when i click on this link i am getting following error: Missing template projects/assign_role, application/assign_role with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :arb, :jbuilder]

Upvotes: 0

Views: 39

Answers (1)

SSR
SSR

Reputation: 6438

This is because you are requesting a page to be displayed but it is not there. so you should create a page under app/views

Create "projects" folder under app/views

Then create "assign_role.html.erb" under app/views/projects/

Upvotes: 1

Related Questions