lundi 27 avril 2015

Nested routes error in Rails

In my rails application I have this routes

resources :jobs do
  resources :job_applications, :path =>  'applications' do
    member do 
      put :change_stage
    end
  end
end

And I have a method called change_stage in my job_application controller Actually I'm trying to change one params of the job_application in an modal so for this I have this in the modal body

<%=form_for :job_application, :url => change_stage_job_job_application.(params[:application_status]), :html => {:method => :post, :class => 'form-horizontal' } do |f| %>

<%= label :status, 'reject' %>
<%= f.radio_button :application_status, 'reject' %><br>
<%= label :status, 'interview' %>
<%= f.radio_button :application_statuss, 'interview' %><br>
<%= label :status, 'hired' %>
<%= f.radio_button :application_status, 'hired' %>

<% end %>

but I'm getting this error

undefined local variable or method `change_stage_job_application' for #<#<Class:0xb463b49c>:0xb463ac04>

What is wrong in my form

Aucun commentaire:

Enregistrer un commentaire