Not your basic "Where to put non-rails stuff" question

Hello,

I’m not that clear on where some things go - and would rather put them
in the right place out the gate than go back and fix them. I’m working
my way through several Ruby/Rails books I got from O’Reilly - with a
particular project in mind - and that project presents some
not-so-typical requirements.

I want to have a rails-based web-app to gather data, and then use the
data to generate static web pages for consumption by a web server that
doesn’t support server-side scripting (just accept it as given). I’ll
probably use ruby/dbi to generate the html pages (unless it’s
better/easier to do this from rails - please share if you have an
recommendations).

Part or this project is about annotating images, in files which will be
stored on the filesystem. The image files are required to be in a given
directory relative to the target site’s home directory
(“images/filename.jpg”)on the target hosting.

If I put the image files in public/images would the relative path in my
view controlers be the same? (I’m just wrapping my head around the view
side - having just gotten the Model / Migration / Scaffold stuff
working.)

If I put the image files in public/images, would the value of
image.filename in by Image model best be “images/filename.jpg” or is it
just as easy to add the relative directory to the name in the viewer?

Or should I just put the image files in public (not a subdirectory) and
pre-pend the proper relative directory only on the output html page
generation (which implies copying the files from my rails public
directory to my other-site/images directory?

Thanks in advance for your assistance.

Pauli

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs