link-to

    0熱度

    2回答

    我有一些麻煩。 我有3種型號:論壇帖子 論壇 has_many :topics, dependent: :destroy 主題 belongs_to :forum has_many :posts, dependent: :destroy 發表belongs_to的:話題 論壇控制器 class ForumsController < ApplicationController

    0熱度

    1回答

    我有一個印象,link_to_if應與此代碼的工作沒有任何問題: <%= link_to_if locker.student, locker.student.fullname, locker.student do %> <div>more complicated</div> <% end %> 我得到的「全名」無方法錯誤。 所以,我的印象是,當學生存在時,鏈接將被創建,否則塊會被渲

    1熱度

    1回答

    如何將RDFa Lite 1.1property="url"添加到我的Rails link_to? <%= link_to "Lipsum", my_path, property: "url" %>自然不起作用。 期望的結果: <a href="/my/path" property="url">Lipsum</a>

    0熱度

    1回答

    我在RoR中有點新,我遇到了一些問題,希望你們能幫助我。 在控制器: def process @order = Order.includes({folders: :document}, {folders: :service}).find(params[:order_id]) end 在視圖: [email protected] do |folder| p b

    2熱度

    3回答

    我正在使用一系列link_to塊在我的應用程序中創建按鈕。但是我發現這些鏈接並沒有結束工作。當我將鼠標移到按鈕上時,它會識別鏈接,firefox左下角顯示正確的URL,但是當我點擊時,沒有任何反應。我的終端或開發日誌中也沒有任何內容出現。 我的代碼如下: <%= link_to new_folder_path do%> <div class="btn btn-default add-bu

    1熱度

    3回答

    我創建了模型用戶和模型配置文件。在我的主頁上,我在鏈接到編輯配置文件的dropmenu導航欄中有一個鏈接。 我面對的問題是「沒有路線匹配{:action =>」edit「,:controller =>」profiles「,:id => nil}缺少必需的鍵:[:id]」。 編輯頁面的路由是「edit_profile_path」,帶有動詞GET和URI模式「/profiles/:id/edit(.:

    1熱度

    1回答

    設計師給了我下面的代碼片段: <a href="register_learner.html"> <div class="service-block service-block-sea service-or"> <div class="service-bg"></div> <i class="icon-custom icon-color-light roun

    0熱度

    1回答

    以下是索引操作的一段代碼。有人可以解釋我使用第三個參數:class =>'action show',在行號27,28和29的link_to助手中。如果沒有這個,代碼似乎也能正常工作。我是一名鐵桿菜鳥,並提前致謝。 <div class="subjects index"> <h2>Subjects</h2> <%= link_to("Add New Subject", '#',

    1熱度

    1回答

    A)這是工作環節: <%= link_to "+ Start a club", account_setup_path(id: :start_a_club) %> B)這就是我想要它看起來像: <a class="list-group-item" href="#"><i class="fa fa-plus fa-fw hot-pink"></i>  Start a club</a>

    1熱度

    1回答

    我通過結果的收集迭代,而我在我的代碼有這樣link_to: <%= link_to "", "#{expo.id}/edit" %> 我期望它去<domain>/exhibitions/3/edit。 我已經在/exhibitions頁面中,所以我就是從那裏得到的。問題是,它是去<domain>/exhibitions/3並在那裏結束。出於某種原因,它不會在URL的edit部分上標記。誰能幫忙