Skip to content

Duplicate row

Sean edited this page Aug 22, 2017 · 1 revision

To add an inline link for row duplication, on the index page.

Add the Link

  index do
    .
    .
    actions defaults: true do |event|
      link_to 'Dup', clone_admin_conference_event_path(event.conference,event)
    end
  end

Create the member action

  • Clone the object
  • Redirect to :new
  • For cascading clones of child objects, see the linked issue below.
  member_action :clone, method: :get do
    @event = resource.dup
    render :new, layout: false
  end

Reference

Clone this wiki locally