Answered myself:
actionlink: :type => :record, :position => false
method:
def copy
      record = Copia.find(params[:id])
      ...clone code....
end
copy.rjs:

row_id = element_row_id(:action => :list, :id => @original_record.id)
new_row_id = element_row_id(:action => :list, :id => @record.id)
page.insert_html :after, row_id, :partial => 'list_record', :locals =>
{:record => @record}
page << "ActiveScaffold.stripe($('#{active_scaffold_tbody_id}'))"
page << "ActiveScaffold.hide_empty_message('#
{active_scaffold_tbody_id}','#{empty_message_id}');"
page << "ActiveScaffold.increment_record_count('#
{active_scaffold_id}');"
page.select("##{new_row_id} td").each do |td|
   page.visual_effect :highlight, td
end



On Mar 19, 11:34 am, naaano <[email protected]> wrote:
> Im trying to implement a "copy record" function.
> However, default methods and options for action_links doesn't seem to
> fit, since de :position => :after, makes the active_scaffold.js to
> display a Show style inline-adapter, and won't insert the record.
> I tried to replicate the on_create.rjs function, but by setting
> position => :false it doesn't give me the before-element.id
> (active_scaffold_tbody_id), and using position => :after,
> active_scaffold.js disables the link and renders a green box with no
> content.
>
> any approach?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to