Rails Bootstrap modal no route matches -


i'm trying use bootstrap modal update taskpriority field in the tasks model.

this line in modal isn't working:

<%= simple_form_for :task, :url => url_for(:action => 'update', :controller => 'tasks'), :method => 'put' |f| %> 

the tasks controller has code:

# put /tasks/1 # put /tasks/1.json def update   @task = task.find(params[:id])    respond_to |format|     if @task.update_attributes(params[:task])       format.html { redirect_to @task, notice: 'task updated.' }       format.json { render json: @task }     else        format.html { render action: "edit" }       format.json { render json: @task.errors, status: :unprocessable_entity }     end   end end 

the error is:

no route matches {:action=>"update", :controller=>"tasks"} 

thanks !

ps - easier way create pop-up change 1 field?

update 1

my rake routes tasks

                 tasks    /tasks(.:format)                   tasks#index                      post   /tasks(.:format)                   tasks#create             new_task    /tasks/new(.:format)               tasks#new            edit_task    /tasks/:id/edit(.:format)          tasks#edit                 task    /tasks/:id(.:format)               tasks#show                      put    /tasks/:id(.:format)               tasks#update                      delete /tasks/:id(.:format)               tasks#destroy 

try -

<%= simple_form_for @task, :url => tasks_path, :method => :post |f| %> 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -