0

How to render :new and set the location to question/:id/new/answer?

render :location => new_question_path sets the location to question/:id/answer

render :location => "/question/#{params[:id]}/new/answer" did not work either.

Relevant route: get '/question/:id/new/answer' => 'answers#new', as: :new_answer

B Seven
  • 44,484
  • 66
  • 240
  • 385

1 Answers1

2

may be use

resources :questions do
  get 'new/answer', :on => :member
end

and will see the path via rake routes

achempion
  • 794
  • 6
  • 17