Created
April 16, 2013 08:28
-
-
Save SkyKOG/5394338 to your computer and use it in GitHub Desktop.
redirect
This file contains hidden or 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
class PerformaonesController < InheritedResources::Base | |
def new | |
@performaone = Performaone.new(:employee_id => params[:id], :hospital_id => params[:hospital_id]) | |
end | |
def create | |
@performaone = Performaone.new(params[:performaone]) | |
respond_to do |format| | |
if @performaone.save | |
format.html { redirect_to @performaone, notice: 'Performance Entry for the employee was successfully created.' } | |
format.json { render json: @performaone, status: :created, location: @performaone } | |
else | |
format.html { render action: "new" } | |
format.json { render json: @performaone.errors, status: :unprocessable_entity } | |
end | |
end | |
def index | |
@performaones = Performaone.order(:employee_id) | |
respond_to do |format| | |
format.html | |
format.csv { send_data @performaones.to_csv } | |
format.xls # { send_data @performaones.to_csv(col_sep: '\t') } | |
end | |
end | |
end | |
def delete | |
@performaone.destroy | |
redirect_to(new_performaone_path(:hospital_id => @performaone.hospital_id, :id => @performaone.id)) | |
end | |
end |
Author
SkyKOG
commented
Apr 16, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment