0

タグ

<%= link_to('Local', url_for(:action => 'point_c', 
                             :gateway_id => gatewayid, 
                             :id => deviceid, 
                             :point_id => point.cn), :method => :post) %>

次の URL を生成します。

/inputs/point_c/5?gateway_id=f1486bee48c24765&point_id=22

しかし、私は次のようなURLを作成する必要があります:

/inputs/5/point_c?gateway_id=f1486bee48c24765&point_id=22

これは、入力、出力など、複数のコントローラーがアクセスする共有ページです。

ルート:

resources :inputs do
  member do
    post :pointc
  end
end

編集

これは複数のコントローラーからのものであるため、名前付きルートを使用できません。コントローラーを自動生成したい

4

0 に答える 0