I am trying to create a button/link to set a variable on my edit collection page which would all the user to set an artwork as the default image for the collection. I created this method but im not sure if it should go in the artwork or collection controller. I am also getting confused about the routes. This shouldn't be so hard but I can't figure it out!
I am trying to create a button/link to set a variable on my edit collection page which would all the user to set an artwork as the default image for the collection. I created this method but im not sure if it should go in the artwork or collection controller. I am also getting confused about the routes. This shouldn't be so hard but I can't figure it out!
def set_deault @user = current_user collection = Collection.find params[:collection_id] artwork = Artwork.find params[:id] collection.default_image = artwork.thumbnail end