Return an if condition that is true if all the prior segments can be generated. If there are no optional segments before this one, then nil is returned.
Source Code
# File action_controller/routing/segments.rb, line 45 def all_optionals_available_condition(prior_segments) optional_locals = prior_segments.collect { |s| s.local_name if s.optional? && s.respond_to?(:local_name) }.compact optional_locals.empty? ? nil : " if #{optional_locals * ' && '}" end
<code/>and<pre/>for code samples.