error fixes

This commit is contained in:
2014-06-14 14:16:16 +02:00
parent 25743f8b9f
commit b1c46a3dc3
10 changed files with 29 additions and 11 deletions

View File

@@ -3,7 +3,7 @@ class ThemengruppenController < ApplicationController
# GET /themengruppen.json
load_and_authorize_resource
def index
@themengruppen = Themengruppe.public.order(:priority).reverse
@themengruppen = Themengruppe.where(:public=>true).order(:priority).reverse
@toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()}]
@toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('common.verwalten'), :path=>verwalten_all_themengruppen_path()}]

View File

@@ -4,7 +4,7 @@ class WikisController < ApplicationController
def show
@wiki = Wiki.find(params[:id])
@fragen = @wiki.fragen
@toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('wiki.edit'), :path=>verwalten_wiki_path(@wiki)}]
@toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('wiki.edit'), :path=>verwalten_thema_path(@wiki)}]
end
def wiki

View File

@@ -31,10 +31,12 @@ class Fetprofile < ActiveRecord::Base
accepts_nested_attributes_for :memberships, :reject_if=>lambda{|a| a[:typ].blank?|| a[:start].blank? ||a[:gremium_id].blank?}, :allow_destroy=>true
has_many :nlinks, as: :link
def validate_birthday
unless Date.valid_date?(birth_year, birth_month, birth_day)
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")
end
end
end
def title

View File

@@ -38,7 +38,7 @@ belongs_to :fetprofile
def self.find_for_facebook_oauth(auth, signed_in_resource=nil)
logger.debug auth.to_s
logger.debug "DDD Username= #{auth.username}"
# user = User.where(:provider => auth.provider, :uid => auth.uid).first
user = User.where(:provider => auth.provider, :uid => auth.extra.raw_info.uid).first
unless user
user = User.create(name:auth.uid,
provider:auth.provider,

View File

@@ -8,9 +8,9 @@
<%= interninfo.street %>
</p>
<p>
<%= raw("<b>Telefon: </b>")+ interninfo.telnr + "<br>" unless interninfo.telnr.empty?%>
<%= raw("<b>Handy: </b>") +interninfo.hdynr unless interninfo.hdynr.empty? %><br>
<%= raw("<b>Skype: </b>") +interninfo.skype unless interninfo.skype.empty? %><br>
<%= raw("<b>Instant Messaging: </b>") +interninfo.instant unless interninfo.instant.empty? %><br>
<%= raw("<b>Telefon: </b>")+ interninfo.telnr + "<br>" unless (interninfo.telnr.nil? || interninfo.telnr.empty?) %>
<%= raw("<b>Handy: </b>") +interninfo.hdynr unless interninfo.hdynr.nil? || interninfo.hdynr.empty? %><br>
<%= raw("<b>Skype: </b>") +interninfo.skype unless interninfo.skype.nil? || interninfo.skype.empty? %><br>
<%= raw("<b>Instant Messaging: </b>") +interninfo.instant unless interninfo.instant.nil? || interninfo.instant.empty? %><br>
</p>