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