Sha256: aafa87a8889364300cfb13ec33e073d3128525cee10df6476caa8f302421994b
Contents?: true
Size: 1.28 KB
Versions: 10
Compression:
Stored size: 1.28 KB
Contents
class PeopleController < ApplicationController acts_as_multipart_form :name => :hire_form, :parts => [:person_info, :job_info], :model => "Person", :form_route => "person_hire_form" def person_info @person = Person.find(params[:id]) end def person_info_update @person = Person.find(params[:id]) @person.multipart_form_controller_action = "person_info_update" if params[:person] and params[:person][:person] @person.update_attributes(params[:person][:person]) return { :valid => @person.valid? } else return { :valid => false } end end def job_info @person = Person.find(params[:id]) end def job_info_update @person = Person.find(params[:id]) @person.multipart_form_controller_action = "job_info_update" if @person.update_attributes(params[:person]) return {:valid => true} else return {:valid => false } end end def hire_form #puts "stub method for the hire form" #@person = Person.find(params[:id]) respond_to do |format| format.html end end def index @people = Person.all load_multipart_form_index_links(:hire_form, @people) respond_to do |format| format.html end end def show respond_to do |format| format.html end end end
Version data entries
10 entries across 10 versions & 1 rubygems