ruby on railsで掲示板サイトを作っています。
と の 2 つの足場を生成Topic
しForum
ました。Topic
所属先Forum
。
ユーザーが新しいトピックを作成するときは、forum_id (GET 変数) を渡す必要があります。のようなもの:
http://example.com:3000/topics/new/1
次に、ユーザーがフォームを送信すると、POST リクエストで forum_id を返します (非表示の html フィールドを介して?)。
それを行う正しい方法は何ですか?
ありがとう
ルート:
resources :forums
get "admin/index"
resources :posts
resources :topics
resources :users
match '/signup', :to => 'users#new'
get '/login', :to => 'sessions#new', :as => :login
match '/auth/:provider/callback', :to => 'sessions#create'
match '/auth/failure', :to => 'sessions#failure'
match '/topics/new/:id', :to => 'topics#new'