Thank you so much for the help, it set me on the right track. My primary goal 
was to hide the show view after the user clicked the link, turned out to be 
easy. I overrode on_action_update.js.erb like this:

<%= render :super %>
<% if action_name == 'process_note' %>
ActiveScaffold.remove('<%= element_row_id action: :nested %>');
<% end %>

and it works perfectly.

Jim Crate

> On Nov 28, 2018, at 12:34 AM, Sergio Cambra <[email protected]> wrote:
> 
> Hi
>  
> There is no way inside ActiveScaffold to update show view, if you want to 
> update row and show view you have to write your own view. There is 2 ways:
>  
> Create app/views/controller/on_action_update.js.erb, call render :super and 
> add code to update show view:
>  
> <%= render :super %>
> <% if action_name == 'your custom action' %>
> $('#<%= element_row_id action: :nested %> .show-view dl').replace('<%= j 
> render('show_columns', columns: active_scaffold_config.show.columns, record: 
> @record) %>');
> <% end %>
>  
> Or you can write your own view, and change your controller to:
>  
> process_action_link_action(:your_action_name) do |record|
>    ...
> end
>  
> # your_action_name.js.erb
> <%= render :partial => 'update_messages' %>
> ActiveScaffold.update_row('<%= element_row_id(action: :list, id: @record.id) 
> %>', '<%= j render('list_record', record: @record) %>');
> ActiveScaffold.scroll_to('<%= element_row_id(action: :list, id: @record.id) 
> %>', true);
> <%= render :partial => 'update_calculations', :formats => [:js] %>
> $('#<%= element_row_id action: :nested %> .show-view dl').replace('<%= j 
> render('show_columns', columns: active_scaffold_config.show.columns, record: 
> @record) %>');
>  
> El miércoles, 28 de noviembre de 2018 4:38:38 (CET) Jim escribió:
> I added a link to a show action view to mark an item as processed. Using 
> process_action_link_action in the action, the row is updated, but the show 
> view is not updated and is still showing. Is there an easy way to close the 
> show view as if the cancel link was also clicked? Alternatively, if the show 
> view could be updated that would be ok as well.
> 
> -- 
> 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 post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/activescaffold.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.

Reply via email to