0
Dropbox와 비슷한 기능을 가진 Ruby on Rails 프로젝트를 진행 중입니다. 보석은 내가 사용부트 스트랩 모달을 사용하여 편집 부분 양식 렌더링
내가 부트 스트랩을 통합하기 위해 노력하고
- carrierwave : 업로드 파일을
- acts_as_tree : 폴더 디렉토리
- 슬림 : 청소기 HTML
- 부트 스트랩 4
사용자가 내 모델에있는 file_name 속성을 편집 할 수 있도록 편집 양식을 렌더링하는 모달.
- @documents.each do |document|
= link_to document.file.filename, document.file.url
b = document.file_name
= number_to_human_size(document.file.size, :precision => 2)
= document.content_type
= document.updated_at
= link_to "Download", document.file.url
#renameButton.button.btn.btn-primary data-toggle="modal" data-target="#renameModal" Rename
#renameModal.modal.fade tabindex="=1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"
.modal-dialog role="document"
.modal-content
.modal-header
#exampleModalLabel.h5.modal-title Rename folder
button.close data-dismiss="modal" aria-label="Close"
span aria-hidden="true" ×
.modal-body
= form_for document do |f|
= f.label :name
= f.text_field :file_name
= f.submit
.modal-footer
button.btn.btn-outline-success data-dismiss="modal" aria-hidden="true" Close
button.btn.btn-outline-danger Save changes
= link_to "Delete", document, :confirm => 'Are you sure?', :method => :delete
내가 가진 문제는 내가 내 "이름 변경"버튼 중 하나를 클릭 할 때마다, 모달 내부 렌더링 편집 양식은 항상 대신 선택한 하나의 첫 번째 파일 엔트리를 가리키는 지입니다.
내 do-loop 내부에 모달이 있다고해서이 문제가 발생합니다.
이 방법이 있습니까?
이것은 매력처럼 작동합니다! 너무 많은 마 야크 감사합니다! –