Question

I've created an Event engine that consists of Event date and Event description.

The admin section now has an Events tab and the frontend has an Events page, which lists all Events.

What if I want to access the Events on the home page instead? How do I go about that?

Thanks!

Était-ce utile?

La solution

If your engine is Event, you could access in the front-end the data in this way:

Refinery::Events::Event.all # You can make your query here

I really recommend override the pages controller and customise you homepage action, there you can have an instance variable to access the data at your view.

Here you can find more information about engines. Check the namespace routes. Hope it helps.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top