I’ve sucessfully created an upload and view for one picture connected to
current_user, but who am I suppose to create MANY pictures to one user?
I thought I basically could rename everything to “entries” and “images”
which once were called “entry” or “image”.
change the controller:
entry_controller ===> entries_controller
the USER model:
has_one :entry ===> has_many :entries
all the folders containing entry ===> entries
the “routes”-file with with the correct paths
the folders in the public directory to Entries and Images
(but not change the ENTRY-model name)
Well, this doesn’t work.
I recieve a multitude of errors
like ‘image_relative_path’ for Entry:Class
I guess I’m doing this all wrong, so any help is welcome.
I’m rephrasing my question,
(as I wrote before)I’ve sucessfully created an upload and view for one
picture connected to current_user, but who am I suppose to create MANY
pictures to one user?
I’m well aware that the models need to have “has_many” and “belongs_to”
and these are right. but with only “has_many :entries” (and belongs_to
:user) I recieve “unkown method entry”.
However, one problem might be that I haven’t quite understood “how to
know where” to write “entry” and where to write “entries” in the code.
(even though I thought this just should be dependent on the “has_many”
in the model).
So I’ve tried a couple of diffrent ways to figure out where they should
be called “entries” and “entry”, but more than it results in
“‘image_relative_path’ for Entry:Class”
pretty please help me