You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, after follow the docs and the demo for multiple files upload seems very confusing use shrine with uppy js
in the docs is written to use this method
def create
new_photos_attributes = params[:files].inject({}) do |hash, file|
hash.merge!(SecureRandom.hex => { image: file })
end
photos_attributes = item_params[:photos_attributes].to_h.merge(new_photos_attributes)
item_attributes = item_params.merge(photos_attributes: photos_attributes)
@item = current_user.items.build(item_attributes)
respond_to do |format|
if @item.save
format.html { redirect_to item_url(@item), notice: "Item was successfully created." }
else
format.html { render :new, status: :unprocessable_entity }
end
end
end
But when the action POST is called in the logs show up this undefined method message
undefined method `inject' for nil:NilClass
the view, so i has no idea whats wrong, since i followed the docs and the exemple app.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, after follow the docs and the demo for multiple files upload seems very confusing use shrine with uppy js
in the docs is written to use this method
But when the action POST is called in the logs show up this undefined method message
undefined method `inject' for nil:NilClass
the view, so i has no idea whats wrong, since i followed the docs and the exemple app.
Someone can point what i did that's wrong?
Beta Was this translation helpful? Give feedback.
All reactions