Please ignore the issue. I need to use inline: false in the action link
properties so I could redirect. By default, inline is true, and this
prevents any redirect.
On Thursday, March 23, 2023 at 11:20:39 AM UTC-5 Dennis Bulgatz wrote:
> Hi Sergio,
>
> I have a custom controller action to clone a record. And have an action
> link on the records to initiate the clone.
>
> Cloning works fine.. but I don't need a view template for this action.
>
> The action will be taken from the list view.
>
> What is the redirect/render command I need so I need in the "clone"
> controller method to either
>
> 1. re-render / refresh the list view to include the cloned item
> 2. Show the cloned item with the AS show action
> 3. Edit the cloned item with the AS edit action
>
> conf.action_links.add :clone_record, :type => :member, :method => :post,
> security_method: :create_authorized?, :confirm => "Clone Record"
>
> def clone_record
> record = SomeModel.find(params[:id])
> cloned_record = record.clone_me
>
> flash[:info] = as_("Record Cloned ...#{cloned_record.id}")
> list
> end
>
> Thanks!
>
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/activescaffold/1eb869ef-1c83-49c5-88cb-4d2fb62562a3n%40googlegroups.com.