How to pass parameters to current_user redirection?
def current_user
if(user_id = session[:user_id])
@current_user ||= User.find(user_id)
else
@current_user = nil
end
end
def some_action
redirect_to current_user, param1: "bubbles"
end
resources :doctors, :admins, :agencies
Such a resulting URL would look like foo.com/?param1='bubbles. The tricky thing here, I use STI for different types of users, so each user type has its own 'show' url, so this approach
redirect_to controller: 'thing', action: 'edit', id: 3, something: 'else'
will not work, since each user type has its own controller.
source
share