On 10 September 2010 09:25, Mauro <mrsan...@gmail.com> wrote: > If you know grails, there is a feature like this: <% user.name? %> > that prevents to chek if the value is null or not. > In rails view I have to do > <% if user.name %> > <%= user.name %> > <% end %> > to display user.name if it is not nil. > There is a shortcut or some feature like that in grails? >
<%= user.name if user.name %> may be the most concise, or <%= user.name if user && user.name %> if user may be nil Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.