0

As a user, I want the root page to be dynamic based on different scenarios. As an example, let's say I have the following models:

class User
end

class Event
end

Users can attend events and/or manage events. I want the home page to be one thing is users only attend events. I want a different page if they only manage events. I want yet another if they do both.

How would I go about having dynamic root paths? I would like https://example.com to go to different controller actions based on a condition.

ardavis
  • 9,842
  • 12
  • 58
  • 112
  • Please let me know if I can provide more information. I may be overthinking this a bit. – ardavis Aug 19 '17 at 02:46
  • Since this was voted to close as primarily opinion based, how can I re-word the question to make it less opinion based? The question is a matter of efficiency and Rails convention. – ardavis Aug 19 '17 at 03:08
  • Thanks, I agree with all of that. I have modified the question in an attempt to remove the opinion aspect of it. I choose a direction and asked something specific. – ardavis Aug 19 '17 at 03:35
  • How do you detect whether user has only attend or manage events? Is that will perform faster than just query the events that user attend or manage? – Tai Aug 19 '17 at 03:35
  • @taitrantuan I have modified my question to not be efficiency based. The implementation details for deciding whether they attend or manage events no longer matters. The direction of the question has been changed to having a different `root_path` based on a condition. – ardavis Aug 19 '17 at 03:42

0 Answers0