Is there a way for me to add a separate background image for a specific post on my rails app?
In my rails app I have different mixtapes, and I would like to add a custom background image for some of the mixtapes “show” view (not for every mixtape though).
I would upload the images myself.
Is there a gem or a tutorial that shows me how to accomplish this? Thanks in advance.
There are different ways how to do it, and the easiest one (in my opinion) is to define a CSS selector that is responsible for that and to set it from your Rails application.
Something like the following pseudo-code:
Then your
application.cssfile should include something like:Or you could style your div directly with the necessary style (not tested this one):
But the difficult part is to find for each different post a background image …