Fix backend referer.
This commit is contained in:
parent
e1e9377b21
commit
184c1384c7
|
@ -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
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<%= form_for @entry, url: "/admin/universal_tables/update_entry", html: {class: "form-horizontal main-forms"} do |f| %>
|
||||
<fieldset>
|
||||
<input value="<%= @entry.id %>" type="hidden" name="id">
|
||||
<%= f.hidden_field_tag 'id', f.object.id %>
|
||||
<%= f.hidden_field_tag 'page', params[:page] %>
|
||||
<%= render :partial => "entry_form", :locals => {:f => f} %>
|
||||
</fieldset>
|
||||
<% end %>
|
|
@ -68,7 +68,7 @@
|
|||
<% if index == 0 && can_edit %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills">
|
||||
<li><a href="<%= admin_universal_table_edit_entry_path(entry) %>"><%= t(:edit) %></a></li>
|
||||
<li><a href="<%= admin_universal_table_edit_entry_path(:universal_table_id=> entry.to_param, :page => params[:page]) %>"><%= t(:edit) %></a></li>
|
||||
<li><a href="<%= admin_universal_table_delete_entry_path(entry.id) %>" class="delete text-error" data-method="delete" data-confirm="Are you sure?"><%= t(:delete_) %></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue