diff --git a/app/views/active_scaffold_overrides/_list_inline_adapter.html.erb b/app/views/active_scaffold_overrides/_list_inline_adapter.html.erb new file mode 100644 index 0000000..6d0ac99 --- /dev/null +++ b/app/views/active_scaffold_overrides/_list_inline_adapter.html.erb @@ -0,0 +1,20 @@ +<% + # hotfix for https://github.com/activescaffold/active_scaffold/issues/148 + # remove when fixed + + column_count = if nested? && params[:action] == 'index' + active_scaffold_config_for(nested.parent_model).list.columns.count + 1 + else + active_scaffold_config.list.columns.count + 1 + end +%> +<%# nested_id, allows us to remove a nested scaffold programmatically %> + + +
<%= "#{nested? ? nested.name : id_from_controller(params[:controller])}-view" %> view"> + <%= link_to(as_(:close), '', :class => 'inline-adapter-close as_cancel', :remote => true, :title => as_(:close), 'data-refresh' => (action_name == 'index' ? true : false)) -%> + <%= payload -%> +
+ + +<%= javascript_tag("var action_link = ActiveScaffold.ActionLink.get('#{element_row_id(:action => :nested)}'); if (action_link) action_link.update_flash_messages('#{escape_javascript(render(:partial => 'messages').strip)}');") %>