중첩된 양식을 생성할 수 없음:설치

7199 단어 nested_form

묘사

안녕하세요. 저는 Rails 3.2.6을 사용했습니다. 루비gems와 Repository에서gem을 읽으려고 했지만 "Rails g nested form:install"을 실행할 때 같은 오류가 발생합니다.
다른 분들도 같은 질문이 있으신가요?
도와줘서 고마워요!
Fernando: cms Fernando$rails g 중첩 형식: 설치
  create  public/javascripts/nested_form.js
/Users/Fernando/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/fileutils.rb:243:inmkdir': File exists - /Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/CMS-DZ3-V2.0/cms/public/javascripts (Errno::EEXIST) from /Users/Fernando/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/fileutils.rb:243:infu_mkdir'
에서 오다/Users/Fernando/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/fileutils.rb:217:inblock (2 levels) in mkdir_p' from /Users/Fernando/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/fileutils.rb:215:in 역방향
에서 오다/Users/Fernando/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/fileutils.rb:215:inblock in mkdir_p' from /Users/Fernando/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/fileutils.rb:201:in마다'
에서 오다/Users/Fernando/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/fileutils.rb:201:in mkdir_p' from /Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/CMS-DZ3-V2.0/cms/vendor/cache/ruby/1.9.1/gems/thor-0.15.4/lib/thor/actions/create_file.rb:62:in 블록의 호출
/Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/cMS-DZ3-V2에서 왔습니다.0/cms/vendor/cache/ruby/1.9.1/gems/thor-0.15.4/lib/thor/actions/empty 디렉터리.rb:133:incall' from /Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/CMS-DZ3-V2.0/cms/vendor/cache/ruby/1.9.1/gems/thor-0.15.4/lib/thor/actions/empty_directory.rb:133:in "충돌"을 사용하여 "검사"호출
/Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/cMS-DZ3-V2에서 왔습니다.ruby.0/thor.1/cms/u.1/cms/fundor.1.rb:61:ininvoke!' from /Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/CMS-DZ3-V2.0/cms/vendor/cache/ruby/1.9.1/gems/thor-0.15.4/lib/thor/actions.rb:95:inaction'
/Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/cMS-DZ3-V2에서 왔습니다.ruby.0/thor.1/cms/u.1/cms/fundor.1.rb:26: increate_file' from /Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/CMS-DZ3-V2.0/cms/vendor/cache/ruby/1.9.1/gems/thor-0.15.4/lib/thor/actions/file_manipulation.rb:26:in 복사 파일'
/Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/cMS-DZ3-V2에서 왔습니다.0/cms/vendor/cache/ruby/1.9.1/bundler/gems/nested_form-ebe513b1a7e4/lib/generators/nested_form/install_generator.rb:12:incopy_jquery_file' from /Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/CMS-DZ3-V2.0/cms/vendor/cache/ruby/1.9.1/gems/thor-0.15.4/lib/thor/task.rb:27:inrun'
/Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/cMS-DZ3-V2에서 왔습니다.0/cms/vendor/cache/ruby/1.9.1/gems/thor-0.15.4/lib/thor/invocation.rb:120:ininvoke_task' from /Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/CMS-DZ3-V2.0/cms/vendor/cache/ruby/1.9.1/gems/thor-0.15.4/lib/thor/invocation.rb:126:in 블록에서 all'호출
/Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/cMS-DZ3-V2에서 왔습니다.0/cms/vendor/cache/ruby/1.9.1/gems/thor-0.15.4/lib/thor/invocation.rb:126:ineach' from /Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/CMS-DZ3-V2.0/cms/vendor/cache/ruby/1.9.1/gems/thor-0.15.4/lib/thor/invocation.rb:126:in지도'
/Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/cMS-DZ3-V2에서 왔습니다.0/cms/vendor/cache/ruby/1.9.1/gems/thor-0.15.4/lib/thor/invocation.rb:126:ininvoke_all' from /Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/CMS-DZ3-V2.0/cms/vendor/cache/ruby/1.9.1/gems/thor-0.15.4/lib/thor/group.rb:238:in 스케줄링
/Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/cMS-DZ3-V2에서 왔습니다.0/cms/vendor/cache/ruby/1.9.1/gems/thor-0.15.4/lib/thor/base.rb:425:instart' from /Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/CMS-DZ3-V2.0/cms/vendor/cache/ruby/1.9.1/gems/railties-3.2.6/lib/rails/generators.rb:171:in 호출'
/Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/cMS-DZ3-V2에서 왔습니다.0/cms/vendor/cache/ruby/1.9.1/gems/railties-3.2.6/lib/rails/commands/generate.rb:12:in<top (required)>' from /Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/CMS-DZ3-V2.0/cms/vendor/cache/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in 요구 사항
/Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/cMS-DZ3-V2에서 왔습니다.0/cms/vendor/cache/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:inblock in require' from /Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/CMS-DZ3-V2.0/cms/vendor/cache/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in 로드 의존항'
/Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/cMS-DZ3-V2에서 왔습니다.0/cms/vendor/cache/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:inrequire' from /Users/Fernando/Dropbox/LAB-DZ3/DZ3-2012/CMS-DZ3-V2.0/cms/vendor/cache/ruby/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:29:in'
script/rails:6:inrequire' from script/rails:6:in'

토론 #1

에서 자산관을 사용하면 운행할 필요가 없음rails g nested_form:install.상세함README section.

토론 #2

감사합니다, 점원!
현재 나의 코드는 다음과 같다.
하지만 파일 입력이 내 테이블에 나타나지 않았습니다 = (
나는 간단한 형식을 썼다.너는 무엇이 잘못되었는지 알아낼 수 있니?
감사합니다!
<%=simple_nested_form_for(@admin_post,:html=>{:multipart=>true,:class=>“mainForm”})do | f |%>
    <div class="widgets">
        <div class="left dadosPostagem">
            <!-- Chamada -->
            <div class="widget">

                <div class="head"><h5 class="iList">Novo Post</h5></div>


                <div class="rowElem">
                    <label>Título:<span class="req">*</span></label>
                    <div class="formRight">
                        <%= f.input :title, :label => false, :input_html => { :class => "validate[required]"} %>
                    </div>
                </div>

                <div class="rowElem"><label>Imagem:</label>
                    <div class="formRight">
                    <%= f.nested_form_for :attachments do |attachment_form|  %>

                        <%= attachment_form.input :file, :label => false, :input_html => { :type => 'file', :class => "fileInput", :id => 'fileInput'}  %>

                        <%= attachment_form.link_to_remove "Remove this attachment" %>

                    <% end %>

토론 #셋

내부nested_form_for에서 사용 중simple_nested_form_for이지만 fields_for이 필요합니다.

토론 #4

감사합니다!
현재 모든 것이 응답하고 있지만, 폼 =/

토론 #5

을 보일 때 입력 파일이 나타나지 않습니다. 컨트롤러에 첨부 파일을 만들 수 있습니다. 예를 들어 @admin_post.attachments.build.

좋은 웹페이지 즐겨찾기