링크를 통해 일부 값을 전달 하려는데 이들을 보이지 않게하고 싶습니다. 이 내가 해봤 옵션은 다음과 같습니다 -ROR link_to 메소드 문제
<%= link_to 'Add comment', :controller => :comments, :action => :new, :idea_id => @idea.id, :user_id => @idea.user.id, :method => :post %>
<%= link_to 'Add comment',{ :controller => :comments, :action => :new, :idea_id => @idea.id, :user_id => @idea.user.id}, :method => :post %>
<%= link_to 'Add comment', :controller => :comments, :action => :new, :idea_id => @idea.id, :user_id => @idea.user.id, %>
<%= link_to 'Add comment', new_comment_path, :idea_id => @idea.id, :user_id => @idea.user.id, :method => :post %>
첫 번째 옵션 매개 변수로 취급 방법 : http://localhost:2000/comments/new?idea_id=1&method=post&user_id=1
두 번째 옵션은 - 이렇게 가고 : "라우팅 오류 번호 : 오류 라우팅 원인도 http://localhost:2000/comments/new?idea_id=1&user_id=1 과 http://localhost:2000/comments/new?idea_id=1&user_id=1
네 번째 옵션 - 보이는 좋은 (HTTP :/양식을로드하지만, 물론 같은입니다 - 경로는 "새/의견 /"
세 번째 옵션과 일치/localhost : 2000/comments/new)하지만 두 번째 것과 같은 라우팅 오류가 발생합니다.
내가 뭘 잘못하고 있니?
미리 감사드립니다.
내 경로를 제공하도록 요청 받았다
PS, 그래서 여기에 그들이있다 :
resources :rights
resources :comments
resources :ideas
resources :users
resources :sessions, :only => [:new, :create, :destroy]
root :to => 'main#home'
#match '/comments/new' => "comments#new" # this doesn't help
match '/home', :to => 'main#home'
match '/contact', :to => 'main#contact'
match '/signin', :to => 'sessions#new'
match '/signout', :to => 'sessions#destroy'
match '/signup', :to => 'users#new'
무엇을 당신의 노선 파일은 어떻게 생겼습니까? – Dogbert
'보이지 않음'이란 무엇을 의미합니까? –