Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #6503 (closed defect: wontfix)

Opened 3 years ago

Last modified 2 years ago

[PATCH] Allow simply_helpful to work with nested controllers

Reported by: mathie Assigned to: David
Priority: low Milestone: 1.2.4
Component: Plugins Version: edge
Severity: minor Keywords:
Cc: Tuxie, ivey

Description

I've got two controllers, ArticlesController and PagesController. Pages are nested inside articles with the usual map.resources nesting in config/routes.rb. Whilst using simply_helpful's form_for to create a new form for updating a page, I noticed that the URL it was generating for the form for submitting the change wasn't correct.

This patch changes that. Now, for nested controllers, you supply the nested objects as an array. For example:

<% form_for [@article, @page] do |f| %>
  ...
<% end %>

I've hacked around enough to retain the existing behaviour for non-nested forms.

I don't think it's the most elegant change on the planet, but I was hoping it might inspire somebody else to fix it properly. :-)

Cheers,

Graeme

Attachments

have_form_for_work_with_nested_controllers.diff (5.1 kB) - added by mathie on 10/27/06 14:18:44.
Make simply_helpful's form_for work with nested controllers.
updated_to_latest_version.diff (4.3 kB) - added by mathie on 01/23/07 19:08:52.
Update of the patch to work with the latest simply_helpful

Change History

10/27/06 14:18:44 changed by mathie

  • attachment have_form_for_work_with_nested_controllers.diff added.

Make simply_helpful's form_for work with nested controllers.

01/23/07 19:08:52 changed by mathie

  • attachment updated_to_latest_version.diff added.

Update of the patch to work with the latest simply_helpful

02/20/07 22:22:43 changed by Tuxie

  • cc set to Tuxie.

02/23/07 21:36:23 changed by josh

  • component changed from ActiveSupport to Plugins.

04/17/07 14:02:31 changed by ivey

  • cc changed from Tuxie to Tuxie, ivey.

05/26/07 01:29:27 changed by josh

  • status changed from new to closed.
  • resolution set to wontfix.

Simply Helpful has been moved into Core. So can you please rewrite this for ActionPack. Please reopen once you done so.