On Aug 22, 1:28 pm, 7stud -- <li...@ruby-forum.com> wrote:
> Once you have a way to execute a method when you have the name of the > method as a string, you can get creative: > > model = item_to_destroy.class.to_s.downcase > > self.send("#{model}_path", item_to_delete) > or polymorphic_path(item_to_delete) (which is what gets called if you do button_to('delete', item_to_delete, :method => 'delete') ) Fred -- 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@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.