Fixed some wrong links in startpage. Added gettext-help for controllers.

This commit is contained in:
Benjamin Meichsner 2009-02-01 23:09:03 +01:00
parent 7f09bb55e4
commit d75c206db5
6 changed files with 40 additions and 30 deletions

View file

@ -24,7 +24,7 @@ class FoodcoopController < ApplicationController
end
# if somebody uses the search field:
conditions = "first_name LIKE '%#{params[:query]}%' OR last_name LIKE '%#{params[:query]}%'" unless params[:query].blank?
conditions = ["first_name LIKE ? OR last_name LIKE ?", "%#{params[:query]}%", "%#{params[:query]}%"] unless params[:query].blank?
@total = User.count(:conditions => conditions)
@users = User.paginate(:page => params[:page], :per_page => @per_page, :conditions => conditions, :order => "nick", :include => :groups)
@ -54,12 +54,13 @@ class FoodcoopController < ApplicationController
def invite
@invite = Invite.new
end
# Sends an email
def send_invitation
@invite = Invite.new(:user => @current_user, :group => @group, :email => params[:invite][:email])
if @invite.save
flash[:notice] = format('Es wurde eine Einladung an %s geschickt.', @invite.email)
redirect_to(:action => 'index')
redirect_to root_path
else
render :action => 'invite'
end

View file

@ -35,7 +35,7 @@ class LoginController < ApplicationController
self.return_to = nil
redirect_to redirect
else
redirect_to :controller => 'index'
redirect_to root_path
end
else
current_user = nil