On 30/09/10 11:42 +0200, [email protected] wrote: >From: Jan Provaznik <[email protected]> > >When first_name or last_name is nil, exception was thrown >--- > src/app/views/layouts/_header.haml | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > >diff --git a/src/app/views/layouts/_header.haml >b/src/app/views/layouts/_header.haml >index abf356f..bbd0f2a 100644 >--- a/src/app/views/layouts/_header.haml >+++ b/src/app/views/layouts/_header.haml >@@ -13,6 +13,6 @@ > - link_to account_path do > = t(:hello) + " " > %b >- = @current_user.first_name + " " + @current_user.last_name >+ = "#...@current_user.first_name} #...@current_user.last_name}" > %li.logout > = link_to t(:logout), logout_url >-- >1.7.2.3
ACKing this one. Btw. maybe it could be better to create some '.full_name' method inside User model and check for nil there. In this case, you will get one extra space before last_name when first_name will be nil ;-) -- Michal > >_______________________________________________ >deltacloud-devel mailing list >[email protected] >https://fedorahosted.org/mailman/listinfo/deltacloud-devel -- -------------------------------------------------------- Michal Fojtik, [email protected] Deltacloud API: http://deltacloud.org -------------------------------------------------------- _______________________________________________ deltacloud-devel mailing list [email protected] https://fedorahosted.org/mailman/listinfo/deltacloud-devel
