Sha256: 81021a354abd8e86b049300e877cdcb72bac7ab0546b331c04a563106bd77ee1

Contents?: true

Size: 1.07 KB

Versions: 14

Compression:

Stored size: 1.07 KB

Contents

<% rtc_controller_name = params[:rtc_controller_name].presence || controller_name %>
<% controller_name_singular = rtc_controller_name.singularize %>
<% @controller_name = instance_variable_get("@#{controller_name_singular}") %>

<% partial = params[:rtc_partial].presence || controller_name_singular %>
<% partial_variable = partial.split('/').last %>

var $new_item = $('<%= j(render partial, partial_variable.to_sym => @controller_name, rtc_partial: partial_variable) %>').st_formatRow().addClass('created');

var $rtc = $('.rich_table_component.showing_new_form');
$rtc.removeClass('showing_new_form');
$rtc.find('.resizers').after($new_item);

$rtc.find('.showing_new_form').removeClass('showing_new_form');
$rtc.find('.lvr_entry_edited').removeClass('lvr_entry_edited');
$rtc.find('.rtc_empty_message').remove();

$('.modal').modal('hide');

<% if flash[:error].present? %>
  showGlobalNotification('<%= flash[:error] %>', {type: ERROR});
<% else %>
  showGlobalNotification('<%= flash[:notice] %>', {type: SUCCESS});
<% end %>

<% flash[:error].try(:clear) %>
<% flash[:notice].try(:clear) %>

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rich_table_component-0.0.30 app/views/application/create.js.erb
rich_table_component-0.0.29 app/views/application/create.js.erb
rich_table_component-0.0.28 app/views/application/create.js.erb
rich_table_component-0.0.27 app/views/application/create.js.erb
rich_table_component-0.0.26 app/views/application/create.js.erb
rich_table_component-0.0.24 app/views/application/create.js.erb
rich_table_component-0.0.22 app/views/application/create.js.erb
rich_table_component-0.0.21 app/views/application/create.js.erb
rich_table_component-0.0.18 app/views/application/create.js.erb
rich_table_component-0.0.17 app/views/application/create.js.erb
rich_table_component-0.0.16 app/views/application/create.js.erb
rich_table_component-0.0.15 app/views/application/create.js.erb
rich_table_component-0.0.14 app/views/application/create.js.erb
rich_table_component-0.0.13 app/views/application/create.js.erb