mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
Fix cancan form submit
This commit is contained in:
parent
028ca94d49
commit
96eead47b7
4 changed files with 27 additions and 10 deletions
|
@ -3,6 +3,12 @@ class ApplicationController < ActionController::Base
|
|||
# For APIs, you may want to use :null_session instead.
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
before_filter do
|
||||
resource = controller_name.singularize.to_sym
|
||||
method = "#{resource}_params"
|
||||
params[resource] &&= send(method) if respond_to?(method, true)
|
||||
end
|
||||
|
||||
def after_sign_in_path_for(resource)
|
||||
if resource.admin?
|
||||
(session[:user_return_to].nil?) ? admin_root_path : session[:user_return_to].to_s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue