-1

I tried to use Rails devise: user_signed_in? not working but it not worked. I also tried it after in VM Box, even changing the system but it's not working. please see the image enter image description here. In spite of having signed in, it's showing sgin_in page but not admin page.I'm trying to solve it from 2 days looking for all resources.

I've Ruby 2.3.0 and Rails 5.1.5

fool-dev
  • 7,671
  • 9
  • 40
  • 54
  • I'm confused. It looks like when you sign up it takes you to the admin#index view. it has the sign up/sign in links at the top, but the content shows Admin#index... – jaydel Mar 06 '18 at 18:25
  • 1
    Please show your code. – gwalshington Mar 06 '18 at 18:46
  • please look at this repo, this is mine https://github.com/TechiePriyaRanjan/PrakirtiPuramHomes.git and one you looked in .gif image is of the friend who helped me in resolving the issue. https://github.com/nezirz/testdevise.git this is working fine in his system, but none of the above repo are working in my laptop (Windows 10) and desktop (windows 7) – Priya Ranjan Dubey Mar 07 '18 at 02:07
  • https://imgur.com/a/YLYjE is the output of my friend whose .gif image is posted in this question – Priya Ranjan Dubey Mar 07 '18 at 02:15

1 Answers1

0

your mapping might be different to user, so user_signed_in? would not work then, it changes according to mapping like #{mapping}_signed_in?

also you are on two different routes

users/sign_up

and

admin/index

you need to be consitent there in order for helpers to be working fine

rks
  • 175
  • 7
  • please check the comments of this question I tried almost everything I knew – Priya Ranjan Dubey Mar 07 '18 at 02:27
  • i have checked your code, first of all you don't have an admin page, you only have a user model and a pages_controller, I would suggest you go thru Rails tutorials and understand the MVC concept. There is a good video tutorial for devise here http://railscasts.com/episodes/209-introducing-devise – rks Mar 07 '18 at 02:47