link-to

    0熱度

    1回答

    我想在彈出窗口的數據內容中添加一個鏈接。不會使用<%link_to'將它保存到您的活動',usersavedevents_path,method::post%>,因爲它不起作用,它會進入用戶界面。 視圖 <div class="col-1" tabindex="0" data-container="body" data-trigger="focus" data-toggle="popover" d

    0熱度

    1回答

    我有一個無序的列表,我可以通過點擊每個列表元素來擴展。 list.html.erb <input id="toggle" type="checkbox" unchecked> <label for="toggle"> <li>Implementing Bootstrap</li> </label> <div id="expand"> ... ... </div

    0熱度

    2回答

    我無法使用link_to轉到我的文章/索引頁面。我有以下的link_to: <%= link_to('NEWS', posts_path(subdomain:"news"),:class=>'navtext',:style=>"color:#bfbebc!important;") %> 我的路線: resources :posts , constraints: { subdomain: 'ne

    0熱度

    1回答

    當我試圖讓鏈接去 admin.mysite.com/articles/new ,目前正在使用 link_to 'new article', [root_url(subdomain: 'admin), 'articles/new'].join ,但我肯定有一個更好的(軌道)傳遞PARAMS到LINK_TO root_url方法來做到這一點。有任何想法嗎?

    -1熱度

    1回答

    我想在link_to 添加data-webm-clickable我試圖 link_to(link_hash[:title],link_hash[:path].to_s, data: { webm-clickvalue: link_hash[:class]}) link_to(link_hash[:title],link_hash[:path].to_s, data: { webm: {clic

    0熱度

    1回答

    我正在使用wicked_pdf創建包含數據庫內容的pdf。 首先,我創建了一個用戶,並轉發給看這樣的頁面: <%= @user.name %> <%= link_to 'Create PDF', pdf_pages_path(:user_id => @user.id) %> 我的控制器代碼: class PdfPagesController < ApplicationController

    0熱度

    1回答

    剛更新了Rails 3.2應用程序到Rails 4.2並開始出現一個有趣的錯誤。每當我嘗試在我的郵件程序模板中使用單個參數調用link_to時,出現錯誤。不過,我可以在我的一個常規視圖中完成相同的調用。 在我的郵件來看,我嘗試調用它像這樣: # user_mailer/notify.html.haml ... = link_to "https://example.com" 但是當電子郵件被

    0熱度

    1回答

    當我導航到特定頁面時,我的序列化程序中的重寫函數normalizeResponse與我的路由器model函數中的代碼結合使用,將元數據添加到我的模型中,工作正常。基本上,normalizeResponse先運行,然後我的model功能在我的路由器中運行。 serializers/application.js import App from '../app'; import JSONAPISeri

    1熱度

    2回答

    出於某種原因,我的link_to_if行能夠正常工作,但出現在我的模型(公司)的每個節目視圖中。 下面的代碼: <% @customers.each do |customer| %> <li> <%= link_to_if customer.company_id == @company.id, "#{customer.first_name} #{customer.last_na

    -1熱度

    1回答

    當「的link_to」,而不使用塊它的工作完美: <%= link_to "Ololo", {controller: "posts", action: "upvote", id: post.id}, method: :put, remote: true, class:"nav-link" %> 但是當我嘗試使用它的塊錯誤結束: <%= link_to {controller: "posts"