How can I make the same in Hanami


#1

Hello,

I made a app with Rails where I have to display 10 paintings on the index page and the details on a detail page.

I have solved in in Rails and I wonder if I can do it again with Hanami

What I have used is one helper which reads data by using a external database by using a helper function.
This is now a rake task so I can use it together with the whenever gem to look every day if there is some change.

I have a index page where I display the paintings all together in a masonary way.
I have a detail page where I display some info about a particular painting,

Can I use the same way of working in Hanami or is there a “better” way to achieve this in Hanami.


#2

@rwobben Hi and sorry for the delay in my reply.

You presented a simple use case where both Hanami and Rails are equivalent.

To make this possible with Hanami, you can use RESTful resources, with two actions and corresponding two views: one as index and one for details. You mentioned masonry, so I guess you have some assets to manage, please make sure to read how to handle them in the guides.


#3

There is one thing that makes it complicated.

A read from a external source that needs to be run once a day.
Or can I also use rake task with the whenever gem


#4

@rwobben Yes, use Rake for that. :+1: