AutoCommit Mon Aug 31 17:03:03 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-08-31 17:03:03 +02:00
parent 93dbdedf53
commit 589597509a
4 changed files with 36 additions and 16 deletions

View File

@@ -9,18 +9,17 @@ class FetprofilesController < ApplicationController
@fetprofiles = Fetprofile.order(:vorname,:nachname) if params[:filter]== "all"
@fetprofiles = Fetprofile.where(:active=>false).order(:nachname,:vorname) if params[:filter]== "notactive"
@gremientabs = Gremium.tabs
@toolbar_elements << {:hicon=>'icon-plus', :text=> I18n.t('profile.new_profile'),:path => new_fetprofile_path(@fetprofile) } if can? :new, @fetprofile
@toolbar_elements << {:hicon=>'icon-plus', :text=> I18n.t('profile.new_profile'),:path => new_fetprofile_path(@fetprofile) } if can? :new, @fetprofile
respond_to do |format|
format.html # index.html.erb
end
end
end
def internlist
@fetprofiles = Fetprofile.order(:vorname,:nachname)
end
end
# GET /fetprofiles/1
# GET /fetprofiles/1.json

View File

@@ -32,13 +32,13 @@ class Fetprofile < ActiveRecord::Base
has_many :nlinks, as: :link
def validate_birthday
unless birth_month.nil? || birth_day.nil?
unless Date.valid_date?((birth_year.nil?) ? Date.today.year : birth_year, birth_month, birth_day)
errors.add(:birth_month, "Invalides Datum")
errors.add(:birth_day, "Invalides Datum")
v= false
else
v= true
end
unless Date.valid_date?((birth_year.nil?) ? Date.today.year : birth_year, birth_month, birth_day)
errors.add(:birth_month, "Invalides Datum")
errors.add(:birth_day, "Invalides Datum")
v= false
else
v= true
end
else
v= false
end