erb

    1熱度

    1回答

    給定一個包含標題,年齡和描述標籤的數據文件,我將如何逐個打印這些信息?我試過用一個簡單的方法; <% data.folder.to.file.EXAMPLE.title %> 我得到一個空白,它應該是,沒有錯誤。 而在同一個數據文件中定義的列表上使用循環可以很好地工作; <% data.folder.to.file.EXAMPLE.list.each do |l| %> <li>

    0熱度

    2回答

    我在RailsInstaller的Windows 7上使用Rails 5。我正在關注RailsGuides構建博客。 當我將index.html.erb文件更改爲顯示<h1>Hello Rails</h1>時,我得到了相同的(默認的供應商提供的)查看結果。 彪馬服務器給我這個日誌行: Rendering C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0

    0熱度

    1回答

    刪除按鈕我有我的Rails應用程序返回以下錯誤: No route matches [DELETE] "/requests.3" 我不知道爲什麼。 這裏是(使用自舉3)在請求視圖按鈕鏈接: <%= link_to '<i class="glyphicon glyphicon-remove"></i>'.html_safe, requests_path(request), method

    0熱度

    3回答

    我試圖樣式一個div容器,並添加一個背景圖像,這是一個用戶上傳並存儲在數據庫(adventure.image.url)的圖像。我不確定如何在css文件中嵌入erb代碼。 下面是來自index.html.erb文件中的代碼: <div class="adventure_container"> <% @adventures.each do |adventure|%> <

    1熱度

    1回答

    我正在從rails 4.2(使用bootstrap 3)升級到rails 5(bootstrap 4.0.0.alpha3.1)。 我使用官方bootstrap-rubygemhttps://github.com/twbs/bootstrap-rubygem,我正在按照文檔上的步驟操作,但我遇到的問題是沒有經典的引導助手。 I.e .: menu_group,nav_bar,menu_item,d

    0熱度

    1回答

    我是編程新手,我有一個問題涉及到在軌道中使用ruby製作窗體。我正在創建一個數據庫來存儲產品的單位。這些單元在創建時最初位於存儲處。該位置存儲在單元模型列中。然後我有一個模型商店和一個模型緩解。 class Unit < ActiveRecord::Base belongs_to :store belongs_to :remission attr_accessor :

    0熱度

    2回答

    我有一個下拉菜單,其中包含用戶簡介頁面的鏈接(UserProfile)。 user.user_profile默認情況下不會創建,因此只有在關聯的用戶配置文件存在的情況下鏈接纔會顯示。 我目前有: <% if profile_present? %> <%= link_to "My profile", user_profile_path(current_user.user_profile) %>

    0熱度

    1回答

    我發送一個var在rails中使用它在視圖中,我有一個js文件名稱charts.js.erb被稱爲和我需要使用var在js文件,但無 在我的控制器一 在我看來,法 def index @asd = 'hellow' end 我可以做 .div= @asd 但在我的JavaScript文件 alert('<%= @asd %>'); @asd VAR是零,我已經使用其

    0熱度

    1回答

    我在查找如何爲下面的語法創建link_to標記時遇到了一些問題。 <li class="bg-master-lighter"> <a href="#" class="clearfix"> <span class="pull-left">Logout</span> <span class="pull-right"><i class="pg-power"></i></sp

    1熱度

    1回答

    我是haml的新手,這是我第一次使用它。我在Haml有一個表單來創建標籤。我得到一個 Syntax error: unexpected tString_DEND expecting ')'. unexpected tIDENTIFIER, expecting ')' haml_temp = f.content_tag :div, "", class: "container_button" do