diff --git a/app/controllers/admin/universal_tables_controller.rb b/app/controllers/admin/universal_tables_controller.rb index ab85b43..42b19dc 100644 --- a/app/controllers/admin/universal_tables_controller.rb +++ b/app/controllers/admin/universal_tables_controller.rb @@ -190,7 +190,7 @@ class Admin::UniversalTablesController < OrbitAdminController entry = TableEntry.find(params[:universal_table_id]) table = entry.u_table entry.destroy - redirect_to admin_universal_table_path(table) + redirect_to (request.referrer || admin_universal_table_path(table)) end def update_entry @@ -198,7 +198,7 @@ class Admin::UniversalTablesController < OrbitAdminController entry.update_attributes(table_entry_params) entry.fix_have_data # when new column insert table = entry.u_table - redirect_to admin_universal_table_path(table) + redirect_to admin_universal_table_path(:id=> table.to_param, :page => params[:page]) end def new diff --git a/app/views/admin/universal_tables/edit_entry.html.erb b/app/views/admin/universal_tables/edit_entry.html.erb index 03fbbd8..76b866f 100644 --- a/app/views/admin/universal_tables/edit_entry.html.erb +++ b/app/views/admin/universal_tables/edit_entry.html.erb @@ -1,6 +1,7 @@ <%= form_for @entry, url: "/admin/universal_tables/update_entry", html: {class: "form-horizontal main-forms"} do |f| %>
- + <%= f.hidden_field_tag 'id', f.object.id %> + <%= f.hidden_field_tag 'page', params[:page] %> <%= render :partial => "entry_form", :locals => {:f => f} %>
<% end %> \ No newline at end of file diff --git a/app/views/admin/universal_tables/show.html.erb b/app/views/admin/universal_tables/show.html.erb index acd439f..2710e73 100644 --- a/app/views/admin/universal_tables/show.html.erb +++ b/app/views/admin/universal_tables/show.html.erb @@ -68,7 +68,7 @@ <% if index == 0 && can_edit %>