Created
September 29, 2010 15:48
-
-
Save safarista/602992 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment