【问题标题】:link_to delete not working in rails 4?link_to delete 在 Rails 4 中不起作用?
【发布时间】:2013-12-24 11:21:09
【问题描述】:

目前我正在将我的 rails 应用程序升级到 rails 4。升级后删除方法不起作用。当我检查日志时,它的打印是 get 方法。

code :view file:
<%= link_to image_tag("/images/iconDeleteActive.png", :alt=>"Delete",:border=>"0", :title=>'Delete'),client_admin_property_path    (user_id,property.id,:sort => params[:sort] || 'Commercial'),:method=>:delete %>

routes:
 scope :module => "client_admin"  do
    resources :client_admin do
    resources :properties
    end
    end

log:
Started GET "/client_admin/61/properties/5126?sort=Commercial"
AbstractController::ActionNotFound - The action 'show' could not be found for ClientAdmin::PropertiesController:

对此有什么想法吗?

【问题讨论】:

    标签: routing ruby-on-rails-4


    【解决方案1】:

    尝试将 :method 更改为 'data-method'

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-19
      • 2015-08-16
      • 2013-08-11
      • 1970-01-01
      • 2013-07-18
      相关资源
      最近更新 更多