I put the codes in their respective places and added fomart : html to not seek json , but always the rails spits ActionView :: MissingTemplate : Missing template avatar / update , application / new with { : locale = > [ " en -US" , : us ] : formats = > [: json ] : handlers = > [: erb , : builder , : coffee ] } . searched in
someone have any tip? thank's
$(document).ready(function(){
Dropzone.autoDiscover = false;
var logoDropzone = new Dropzone (".dropzone", {
maxFilesize: 2,
maxFiles: 1,
dictDefaultMessage: "Drop your images here",
paramName: "user[avatar]",
addRemoveLinks: true,
dictRemoveFile: 'Remover'
});
});
def update
@user = User.find(params[:id])
if @user.update_attributes(params[:user])
redirect_to(action: :edit, id: @user, only_path: true,format: :html)
else
render :edit
end
<%= form_for(@user, :method => :put, html: { multipart: true, class: "dropzone"}) do |f| %>
<div class="fallback">
<%= f.file_field :avatar %><br>
<%= f.submit "Save" %>
</div>
<% end %>
</div>
Aucun commentaire:
Enregistrer un commentaire