Hi guys,
i have a model named "project" and i have created routes namespace:
namespace :project do
resources :inprocess do
get ''assign'', :on => :collection
end
resources :suggested do
get ''select_list'', :on => :collection
post ''select_list'', :on => :collection
end
resources :finished
end
One of the routes that i get is new_project_suggested (which is
working fine with the new action) and the edit_project_suggested which
i get an error.
I am calling this action in the "select_list" view:
<% @suggested.each do |s| %>
<tr><td><%= link_to "#{s.title}",
edit_project_suggested_path(s)
%><td></tr>
<% end %>
The strange is that it does go to the url
http://127.0.0.1:3000/project/suggested/21/edit
but i get the error "Routing Error uninitialized constant
ProjectController".
The actions in the project/suggested controller are:
def select_list
@suggested = Project.find_all_by_status("suggested")
end
def edit
@project = Project.find(params[:id])
end
Can you help me with this?? It does not make sense! :/
Thank u in advance
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Any ideas guys??? I would appreciate any suggestion! Regards Kostas -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
namespace :project do
resources :inprocess do
collection do
get => ''assign''
end
resources :suggested do
get ''select_list'', :on => :collection
post ''select_list'', :on => :collection
end
resources :finished
end
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Try this route format:> namespace :project do > resources :inprocess do > collection do > :get => ''assign'' > end > end > resources :suggested do > collection do >:get => ''select_list''>:post => ''select_list'' end end> resources :finished > end >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Kostas Lps wrote in post #976978:> Hi guys, > i have a model named "project" and i have created routes namespace: > namespace :project do > resources :inprocess do > get ''assign'', :on => :collection > end > resources :suggested do > get ''select_list'', :on => :collection > post ''select_list'', :on => :collection > end > resources :finished > endI think you''re abusing nested resources. inprocess, suggested, and finished probably shouldn''t be resources of their own. What are you trying to achieve here? Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org Sent from my iPhone -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Marnen, i have created a projects controller with a field called status. The "status" have the following values: "suggested", "inprogress" and "finished". I want to be able to use these actions: project/suggested/new project/suggested/1/edit project/suggested/assign_to_student ... ... project/finished/new project/finished/1/edit etc The goal is to be able to edit,update,create, delete (and some other actions) a project while having a specific status. The forms in each value should be different. On Jan 26, 5:07 pm, Marnen Laibow-Koser <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Kostas Lps wrote in post #976978: > > > Hi guys, > > i have a model named "project" and i have created routes namespace: > > namespace :project do > > resources :inprocess do > > get ''assign'', :on => :collection > > end > > resources :suggested do > > get ''select_list'', :on => :collection > > post ''select_list'', :on => :collection > > end > > resources :finished > > end > > I think you''re abusing nested resources. inprocess, suggested, and > finished probably shouldn''t be resources of their own. What are you > trying to achieve here? > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > Sent from my iPhone > > -- > Posted viahttp://www.ruby-forum.com/.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hey All,
Fairly new to all this, and having a routing problem I just cannot
figure out.
My routes.rb has:
----------
resources :users do
member do
get ''following''
end
end
My users_controller.rb has:
----------
def following
@title = "Following"
@user = User.find(params[:id])
@users = @user.following.paginate(:page => params[:page])
render ''show_follow''
end
def followers
@title = "Followers"
@user = User.find(params[:id])
@users = @user.followers.paginate(:page => params[:page])
render ''show_follow''
end
In one of my views I''m using:
----------
following_user_path(@user)
Which results in the following error:
----------
No route matches {:action=>"following",
:controller=>"users"}
Can anyone help?
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Hey guys, I''ve been banging my head on this one: doing a remote post with = form_for @event, :url => add_attendees_event_path(@event), :remote => true do |f| No route matches "/events/498/add_attendees" #routes.rb resources :events do post :add_attendees, :on => :member end $ rake routes #=> add_attendees_event POST /events/:id/add_attendees(.:format) Any ideas? Thanks, Garrett -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Garrett! I''m not exactly sure about this, but don''t have you to specify :method => :post on this? HTH Norbert Top posted from Androidphone Am 29.01.2011 02:00 schrieb "Garrett Lancaster" < glancast-jmyiO2ngOJdad6c/EObmYVaTQe2KTcn/@public.gmane.org>:> Hey guys, I''ve been banging my head on this one: doing a remote post with > > = form_for @event, :url => add_attendees_event_path(@event), :remote => > true do |f| > > No route matches "/events/498/add_attendees" > > #routes.rb > resources :events do > post :add_attendees, :on => :member > end > > $ rake routes > #=> add_attendees_event POST /events/:id/add_attendees(.:format) > > Any ideas? > > Thanks, > Garrett > > -- > You received this message because you are subscribed to the Google Groups"Ruby on Rails: Talk" group.> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email torubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> .> For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.>-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
uncomment the last line in config/routes.rb like #match(controller:id :format) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
form_for @event, :url => add_attendees_event_path, :remote => true do |f| try this -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.