Slide 100
Slide 100 text
+ def url_if(t, options, path)
+ options.merge!(t.url_options) if t.respond_to?(:url_options)
+ options[:path] = path
+ ActionDispatch::Http::URL.url_for(options)
+ end
+
def handle_positional_args(t, args, options, segment_keys)
inner_options = args.extract_options!
result = options.dup
@@ -192,17 +198,10 @@ module ActionDispatch
def define_url_helper(route, name, options)
@module.remove_possible_method name
@module.module_eval <<-END_EVAL, __FILE__, __LINE__ + 1
-
- def if_#{name}(t, options, path)
- options.merge!(url_options) if t.respond_to?(:url_options)
- options[:path] = path
- ActionDispatch::Http::URL.url_for(options)
- end
Remove From Eval
eval