ARTLoe
ARTLoe

Reputation: 1799

Devise routing rails 4

Hi i am new to rails so any help will be much appreciated. I have successfully installed the gem devise. I have two table in my schema; Userrs (recruiters) & Userj (jobseekers).

Question: i want to write a method that states if registered user is Userrs (recruiters) go to recruiters_path else if user is Userj (jobseekers) go to jobseekers_path. Any help or advise will be much appreciated.

application controller

  def after_sign_in_path_for(resource_or_scope)
    if is_userr?(current_userr)
      recruiters_path
    else
      jobseekers_path
    end
  end

any help would be much appreciated.

Upvotes: 1

Views: 29

Answers (1)

Uday kumar das
Uday kumar das

Reputation: 1613

In controller write:

if userr_signed_in?

redirect_to recruiters_path

else

redirect_to jobseekers_path

end

Upvotes: 1

Related Questions