Hello guys!
I have smth like this in my routes.rb
map.resource :admin do |admin|
admin.resources :galleries,
:name_prefix => :admin_,
:controller => ''admin/galleries'' do
|gallery|
gallery.resources :images, :collection => { :checked => :delete},
:name_prefix => :admin_,
:controller => ''admin/images''
end
end
This worked fine until i needed to add extra method to REST crud (to
perform action on checked items through form and checkboxes). I added a
method called checked in my images controller.
But when i try to use: form_tag checked_images_path, :method => :delete
in my view
i get undefined local variable or method `checked_images_path''.
Its probably something simple but i can''t see it.
thx
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Hey, I''m not 100% sure but I think it''s because you have name_prefix set to "admin_", so the it would be "admin_checked_images_path". Give that a try and let us know if that works. On Jul 6, 6:31 am, Pawel Jur <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hello guys! > > I have smth like this in my routes.rb > > map.resource :admin do |admin| > > admin.resources :galleries, > :name_prefix => :admin_, > :controller => ''admin/galleries'' do |gallery| > > gallery.resources :images, :collection => { :checked => :delete}, > :name_prefix => :admin_, > :controller => ''admin/images'' > end > end > > This worked fine until i needed to add extra method to REST crud (to > perform action on checked items through form and checkboxes). I added a > method called checked in my images controller. > > But when i try to use: form_tag checked_images_path, :method => :delete > in my view > i get undefined local variable or method `checked_images_path''. > > Its probably something simple but i can''t see it. > > thx > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
AryaAsemanfar wrote:> Hey, > > I''m not 100% sure but I think it''s because you have name_prefix set to > "admin_", so the it would be "admin_checked_images_path". Give that a > try and let us know if that works.Thanks for reply. I tried that, but still i get undefined local variable or method `admin_checked_images_path'' This is strange. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pawel Jur wrote:> AryaAsemanfar wrote: >> Hey, >> >> I''m not 100% sure but I think it''s because you have name_prefix set to >> "admin_", so the it would be "admin_checked_images_path". Give that a >> try and let us know if that works. > > Thanks for reply. > > I tried that, but still i get > undefined local variable or method `admin_checked_images_path'' > This is strange.Ok, I think i solved it. Since its nested it needs another parameter. <% form_tag admin_checked_images_path(@gallery), :method => :delete do %> that did the trick. Now i can finally make checkboxes. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Yes that''s it! I just got the same problem yesterday! So, with that parameter, your are only able to administer checked images related to a gallery at a time, isn''t it? Have you found a cool way to administer all of them at a time, keeping a pretty RESTful design? Thanks. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---