Thanks Colin I finally decided to keep the :subdomain option and let the method decide about what to do with it ( seems to be the common pattern)
Le vendredi 9 novembre 2012 10:26:34 UTC+1, Colin Law a écrit : > > On 9 November 2012 07:27, Erwin <[email protected] <javascript:>> wrote: > > When I have this pattern > > > > sign_me(@user, :event => :authentication, :subdomain => > subdomain) > > > > how can I write it to avoid sending the :subdomain option if > subdomain.nil? > > ( if possible ..) > > > > sign_me(@user, :event => :authentication #?, :subdomain => > subdomain > > unless subdomain.nil? ) > > You could try > sign_me(@user, :event => :authentication, (:subdomain => > subdomain unless subdomain.nil?) ) > or > sign_me(@user, :event => :authentication, :subdomain => > (subdomain unless subdomain.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 > > [email protected]<javascript:>. > > > To unsubscribe from this group, send email to > > [email protected] <javascript:>. > > To view this discussion on the web visit > > https://groups.google.com/d/msg/rubyonrails-talk/-/TOTAudTTAa8J. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/vXU0ybxpA5EJ. For more options, visit https://groups.google.com/groups/opt_out.

