animoni / library-rails-5

0 stars 0 forks source link

Review #1

Open mottalrd opened 5 years ago

mottalrd commented 5 years ago

Why this controller does not create any instance variable? How is the data passed into the view?

https://github.com/animoni/library-rails-5/blob/391f56b099502d5243093b3012550bea408a3aad/app/controllers/books_controller.rb#L24-L33

animoni commented 5 years ago

Okay, I got the message. But I couldn't figure it out how to stay on the same page when the "Random" button is clicked display the picture, and keep also the button so I can click it another time. I tried with link_to and I looked up an html type of "solution", but both of them is redirecting to the unsplash img :( You can see both in the index.html.erb.