From 6acd56229768da02609226543ca36abb4194aeb5 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sat, 16 Feb 2013 11:39:37 +0100 Subject: [PATCH] Link zum Update --- app/controllers/config_controller.rb | 6 +++++- app/views/config/index.html.erb | 4 ++++ config/routes.rb | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/controllers/config_controller.rb b/app/controllers/config_controller.rb index 9edaab2..cb15265 100644 --- a/app/controllers/config_controller.rb +++ b/app/controllers/config_controller.rb @@ -2,5 +2,9 @@ class ConfigController < ApplicationController def index end - + def get_git_update + g = Git.open(".") + flash[:notice] =g.remote("github").fetch + redirect_to url_for(:action => 'index', :controller => 'config') + end end \ No newline at end of file diff --git a/app/views/config/index.html.erb b/app/views/config/index.html.erb index 576558a..b74b03c 100644 --- a/app/views/config/index.html.erb +++ b/app/views/config/index.html.erb @@ -4,4 +4,8 @@ <%= link_to ''.html_safe + 'Userverwaltung',:controller =>"users",:action => "index" %> +<%= link_to 'Update',:controller =>"config",:action => "get_git_update" %> + + + diff --git a/config/routes.rb b/config/routes.rb index c5b1a20..d588a4c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,6 +9,9 @@ Fetsite::Application.routes.draw do scope '(:locale)/admin' do resources :users get 'config',:controller=>:config,:action=>:index +get 'config/get_git_update',:controller=>:config,:action=>:get_git_update + + end