Thursday, 15 April 2010

ruby on rails - Complaints that a route is missing while it's not -



ruby on rails - Complaints that a route is missing while it's not -

i'm working on simple project management web app.

i have 2 different pages view projects.

1. view projects 2. view projects administrator (includes buttons editing / deletion of projects)

because have 2 different pages showing projects decided create custom route directs user custom action in project controller.

however, doesn't (by reason) work, , next error message:

no route matches {:action=>"edit", :controller=>"projects"}

the view:

<%= link_to "manage projects", users_projects_path %>

project controller:

class projectscontroller < applicationcontroller ... def users_projects @users_projects = project.where(:user_id => current_user.id) end ... end

project model:

class project < activerecord::base has_and_belongs_to_many :users, :class_name => 'user' belongs_to :user has_many :tickets, :dependent => :destroy //validation attr_accessible :user_id, :title, :description, :start_date, :end_date end

the problem not giving id parameter route, required.

somewhere, generating link edit_project_path. ensure giving project url generator: edit_project_path(project)

ruby-on-rails ruby-on-rails-3 model controller routes

No comments:

Post a Comment