Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # POST /jobs
- # POST /jobs.xml
- def create
- #ADD THIS LINE
- @catergory= Catergory.find(params[:catergory_id])#This is the new line added
- #It stores the value retrieved from the select box which displays the available categories to be added
- #END ADD
- @job = Catergory.jobs.build(params[:job])
- respond_to do |format|
- if @job.save
- format.html { redirect_to(@job, :notice => 'Job was successfully created.') }
- format.xml { render :xml => @job, :status => :created, :location => @job }
- else
- format.html { render :action => "new" }
- format.xml { render :xml => @job.errors, :status => :unprocessable_entity }
- end
- end
- end
Add Comment
Please, Sign In to add comment