Q:

rails method undefined job_apps

I get and error undefined method 'job_apps' (tried with single form 'job_app' too)
def accept 
        @job_apps = job_apps.find(params[:id])
        @job_apps.update_attribute(status: :accept)
end
def refuse
        @job_apps = job_apps.find(params[:id])
        @job_apps.update_attribute(:status,2)
end

routes:

get 'accept' => 'job_apps#accept'
post 'accept' => 'job_apps#accept'

Tried:
def accept 
        @job_apps = @user.job_app
        @job_apps.update_attribute(status: :accept)
    end

I had similar trouble for calling the job_app in the same view (to see job_app.status as it is table joined with users on user_id) but on stack overflow someone helped me with this (view file):
<th><%= user.job_app.status %></th>

A:

undefined method 'job_apps'

This @job_apps = job_apps.find(params[:id]) is wrong. You need to use the classname when writing a ActiveRecord query. Th below should work
@job_apps = JobApp.find(params[:id])

