diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-02-05 12:41:07 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-02-05 12:41:07 +0100 |
commit | 1c2d8375d32cda0d7819322b165a8270c6500ee9 (patch) | |
tree | 8804da99d69819b2d4253e827230f459c0ebac1c /app/controllers | |
parent | e13f041741fd3a44f407b623da0274d9748c5c54 (diff) | |
parent | bb8168c33f9501fe877345a7bbc7b7f7b64cdfc7 (diff) |
Merge branch 'backup' into develop
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/backup_jobs_controller.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/app/controllers/backup_jobs_controller.rb b/app/controllers/backup_jobs_controller.rb new file mode 100644 index 0000000..e500f4c --- /dev/null +++ b/app/controllers/backup_jobs_controller.rb @@ -0,0 +1,43 @@ +class BackupJobsController < ApplicationController + def index + @backup_jobs = BackupJob.all + end + + def show + @backup_job = BackupJob.find(params[:id]) + end + + def new + @backup_job = BackupJob.new + end + + def create +# @backup_job = BackupJob.new(params[:backup_job]) + @backup_job = BackupJob.new(:started_at => Time.now) + + if @backup_job.save + redirect_to @backup_job, :notice => t('backup_jobs.controller.successfuly_created') + else + render :new + end + end + + # def edit + # @backup_job = BackupJob.find(params[:id]) + # end + + # def update + # @backup_job = BackupJob.find(params[:id]) + # if @backup_job.update_attributes(params[:backup_job]) + # redirect_to @backup_job, :notice => t('backup_jobs.controller.successfuly_updated') + # else + # render :edit + # end + # end + + def destroy + @backup_job = BackupJob.find(params[:id]) + @backup_job.destroy + redirect_to backup_jobs_url, :notice => t('backup_jobs.controller.successfuly_destroyed') + end +end |