ruby

    1熱度

    1回答

    我嘗試批量操作在我的軌道控制,這是我的腳本 def update_by_user user_skill_selected = UserSkillSelected.create(params[:user_skill_selected][:users]) # check through array if all is valid if user_skill_select

    0熱度

    2回答

    我想做的事情是這樣的: http://reference.wolfram.com/language/ref/MaxFilter.html 比方說我的形象有一個通道(灰度模式)。

    0熱度

    3回答

    我是RoR的初學者。我必須開發一個輪詢發生器,所以我用'rails generate scaffold'命令創建了三個模型應用'Formulaire''Question'和'Reponse'。我無法創建我的表單來在同一視圖中生成我的投票,我想我已經在我的公式/ _form中提交了我的問題/ _form,但它不起作用。我試圖在我的form_for(@formulaire)中創建一個form_for(

    -1熱度

    1回答

    這是一個文本文件更名我做了,你把文件中的某些文件夾和程序重新命名他們FILE1.TXT,FILE2.TXT等 它可以完成的工作,但它有兩個問題 它給了我這個錯誤no implicit conversion of nil into String error 如果我添加新的文件到那裏是已經組織文件的文件夾,它們都刪除,並創建新文件 是什麼導致了這些問題? i=0 Dir.chdir 'C:\Use

    0熱度

    2回答

    我想寫一些基本的Rails測試代碼,使用默認的軌道測試框架。我的應用程序是一個簡單的論壇,在這裏用戶可以發佈主題,發表評論等 我試圖測試論壇(即線程)控制器,那就是: forums_controller_test.rb require 'test_helper' class ForumsControllerTest < ActionController::TestCase test "ind

    0熱度

    1回答

    我搜索了整個網絡尋找解決此錯誤的方法。但它不會讓步。根據我的知識,我安裝了所有的庫和依賴項,甚至卸載了ruby和nokogiri並重新安裝。但是這個錯誤仍然存​​在。 Gem files will remain installed in /home/$User/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/nokogiri-1.4.7 for ins

    1熱度

    1回答

    我想構建一個ruby函數來查找所有嵌套數組的通用元素。例如,給出下面的陣列,這就是答案會拿出... [[1, 2, 3], [1, 2], [2]] => [2] [[1, 2, 3], [1, 2, 4]] => [1, 2] 我能做的, arr = [[1, 2, 3], [1, 2], [2]] arr[0] & arr[1] & arr[2] => [2] 但不知道如何

    0熱度

    1回答

    我目前正試圖創建具有軌道新的應用程序,希望在我的應用程序目錄下安裝寶石,得到了以下信息: [email protected]:/dev/movies-forum# bundle install --path vendor/bundle Don't run Bundler as root. Bundler can ask for sudo if it is needed, and install

    1熱度

    1回答

    我想添加與模型錯誤的散列閃存和重定向後。這是控制器: def update current_user.update_attributes(user_params) if current_user.errors.any? flash.keep[:errors] = current_user.errors.messages end byebug

    -1熱度

    5回答

    如果我收到的輸入,如: up 1, down 2, down 3, left 5 我這個保存爲一個數組,它會給我 ["up 1", " down 2", " down 3", " left 5"] 但我需要刪除空格之前向下和向左! 任何想法?