Bootstrap モーダルを使用して、タスク モデルの taskpriority フィールドを更新しようとしています。
これは、機能していないモーダルの行です。
<%= simple_form_for :task, :url => url_for(:action => 'update', :controller => 'tasks'), :method => 'put' do |f| %>
タスク コントローラーには次のコードがあります。
# PUT /tasks/1
# PUT /tasks/1.json
def update
@task = Task.find(params[:id])
respond_to do |format|
if @task.update_attributes(params[:task])
format.html { redirect_to @task, notice: 'Task was successfully updated.' }
format.json { render json: @task }
else
format.html { render action: "edit" }
format.json { render json: @task.errors, status: :unprocessable_entity }
end
end
end
私が得るエラーは次のとおりです。
No route matches {:action=>"update", :controller=>"tasks"}
ありがとう !
PS - 1 つのフィールドを変更するポップアップを作成する簡単な方法はありますか?
更新 1
タスクのレーキ ルート
tasks GET /tasks(.:format) tasks#index
POST /tasks(.:format) tasks#create
new_task GET /tasks/new(.:format) tasks#new
edit_task GET /tasks/:id/edit(.:format) tasks#edit
task GET /tasks/:id(.:format) tasks#show
PUT /tasks/:id(.:format) tasks#update
DELETE /tasks/:id(.:format) tasks#destroy