ruby-on-rails-3

    1熱度

    4回答

    我已經添加gem simple-navigation 3.9.0到我的gemfile 軌3.2.11它運行良好的發展。然而,當我部署到我的生產服務器,並嘗試打開一個網頁,我得到以下錯誤的方法: undefined method `render_navigation' 我不相信這是特定於一個寶石雖然,因爲我有同樣的問題早些時候我使用uuid gem。 使用$ LOADED_FEATURES我發現

    1熱度

    1回答

    我有以下HAML代碼 form_for @user_notification_settings_form do |f| = f.label :follow do div dummy 但它產生 <label for="user_notification_settings_form_follow"> foruser_notification_settings_form

    1熱度

    1回答

    這個問題不是關於如何測試控制器在rails應用程序。 開發寶石我想測試我的寶石是否集成在軌道控制器中。 所以在gem根目錄下運行rspec是在rails環境之外的。 現在我該如何寫一個控制器測試,它可以使用rspec控制器示例組助手,如get或post? 尤其是如果我設置一個例子組元標記:type => :controller,如何RSpec的設置Rails環境,我怎麼能鉤到,爲了說設立路線等 我

    0熱度

    1回答

    使用Carrierwave上傳圖片, 我想寫1個函數來處理我的所有圖片包含幾種尺寸。 image_tag @photo_main.file.url(:img_122x145) rescue nil 的:img_120x120在Carrierwave上傳定義,但爲什麼:它的名字前img_120x120分號?這是什麼格式? 通緝結果: def get_avatar(size) imag

    17熱度

    1回答

    我已經使用JBuilder創建了json視圖。但是我想將它預先加載到數據對象中,所以Backbone可以在不提取數據的情況下儘早訪問數據。 我怎樣才能使list.json.jbuilder視圖到我list.html.erb看法? 通常沒有JBuilder的,我會做這樣的事情: <div data-list="<%= @contents.to_json %>"></div>

    0熱度

    1回答

    test_app /應用/資產/樣式表/ application.css.scss @import 'compass'; @import 'variables'; @media only screen and (min-width: $breakpoint-medium-additional-width) { @import 'partials/medium-additional';

    1熱度

    1回答

    我使用RGhost-Rails生成PDF文件(帶有惡意pdf)的條形碼。 我有下面的代碼(在Ruby on Rails的3) <% doc=RGhost::Document.new :paper => [7,2]%> <% doc.barcode_code39('1234567', :text => {:size => 10, :offset => [0,-10], :enable => [:t

    0熱度

    1回答

    我有幾個計算出的值作爲我risk.rb模型的一部分 before_save :calculate_risk def calculate_risk self.risk1_total = self.component1 * self.component2 * self.component3 self.risk2_total = self.component4 * self.com

    0熱度

    2回答

    我在一個應用程序,允許用戶去根URL像這樣工作的路由: http://localhost:3000/param_here 我的路線是建立類似如下: match '/:test' => redirect { |params| "/?id=#{params[:test]}" } 這個問題是我的其他路線正在拾起並被重定向。 完全Route.rb Myapp::Application.routes.d

    1熱度

    1回答

    我剛剛安裝了active_admin並創建了第一個資源 - 視頻 - 完美查找。一切都像魅力一樣工作。 但是,現在我試圖添加'用戶'和'事件',當我在菜單中導航到相同的消息時,它失敗。 這裏是這樣說的: ArgumentError in Admin/events#index Showing /Users/markwalker/.rvm/gems/ruby-1.9.3-p327/gems