Permalink
Browse files

removed (more) binding from concat - (depricated)

  • Loading branch information...
1 parent 6541c30 commit d5bc420e58c485e26258a32611ed8423cfed9370 @niklas committed Jul 14, 2009
Showing with 13 additions and 13 deletions.
  1. +13 −13 lib/resourceful_views.rb
View
@@ -141,12 +141,12 @@ def #{helper_name}(*args, &block)
opts[:sending] = opts.delete(:parameters) and ResourcefulViews.deprecation_warning('Please use :sending instead of :parameters') if opts[:parameters]
parameters = opts.delete(:sending) || {}
if block_given?
- concat(form_tag(#{resource.name_prefix}#{resource.plural}_path(*args), opts), block.binding)
+ concat(form_tag(#{resource.name_prefix}#{resource.plural}_path(*args), opts))
parameters.collect{ |key, value|
- concat(hidden_field_tag(key.to_s, value, :id => nil), block.binding)
+ concat(hidden_field_tag(key.to_s, value, :id => nil))
}
yield
- concat('</form>', block.binding)
+ concat('</form>')
else
opts_for_button = opts.delete(:button) || {}
opts_for_button.merge!(:type => 'submit')
@@ -371,14 +371,14 @@ def build_list_helpers(resource)
def #{resource.singular}_list(opts={}, &block)
content = capture(&block)
opts[:class] = ResourcefulViews.resourceful_classnames('#{resource.singular}_list', *(opts.delete(:class) || '').split)
- concat(content_tag((opts[:ordered] ? :ol : :ul), content, opts), block.binding)
+ concat(content_tag((opts[:ordered] ? :ol : :ul), content, opts))
end
def #{resource.singular}_item(*args, &block)
opts = args.extract_options!
opts[:class] = ResourcefulViews.resourceful_classnames('#{resource.singular}', *(opts.delete(:class) || '').split)
opts[:id] = '#{resource.singular}_' + args.first.id.to_s unless args.empty?
content = capture(&block)
- concat(content_tag(:li, content, opts), block.binding)
+ concat(content_tag(:li, content, opts))
end
end_eval
end
@@ -404,14 +404,14 @@ def build_table_helpers(resource)
def #{resource.singular}_table(opts={}, &block)
content = capture(&block)
opts[:class] = ResourcefulViews.resourceful_classnames('#{resource.singular}_table', *(opts.delete(:class) || '').split)
- concat(content_tag(:table, content, opts), block.binding)
+ concat(content_tag(:table, content, opts))
end
def #{resource.singular}_row(*args, &block)
opts = args.extract_options!
opts[:class] = ResourcefulViews.resourceful_classnames('#{resource.singular}', *(opts.delete(:class) || '').split)
opts[:id] = '#{resource.singular}_' + args.first.id.to_s unless args.empty?
content = capture(&block)
- concat(content_tag(:tr, content, opts), block.binding)
+ concat(content_tag(:tr, content, opts))
end
end_eval
end
@@ -468,11 +468,11 @@ def #{helper_name}(*args, &block)
args_for_fields_for = ['#{resource.singular}']
args_for_fields_for.push(args.pop) if args.length > #{number_of_expected_args}
opts[:class] = ResourcefulViews.resourceful_classnames('#{resource.singular}', 'create', *(opts.delete(:class) || '').split)
- concat(form_tag(#{resource.name_prefix}#{resource.plural}_path(*args), opts), block.binding)
- concat(resource_attributes.collect{|key, value| hidden_field_tag('#{resource.singular}[' + key.to_s + ']', value, :id => nil)}.join, block.binding)
- concat(parameters.collect{|key, value| hidden_field_tag(key, value, :id => nil)}.join, block.binding)
+ concat(form_tag(#{resource.name_prefix}#{resource.plural}_path(*args), opts))
+ concat(resource_attributes.collect{|key, value| hidden_field_tag('#{resource.singular}[' + key.to_s + ']', value, :id => nil)}.join)
+ concat(parameters.collect{|key, value| hidden_field_tag(key, value, :id => nil)}.join)
fields_for(*args_for_fields_for, &block)
- concat('</form>', block.binding)
+ concat('</form>')
else
label = opts.delete(:label) || 'Add'
opts_for_button = opts.delete(:button) || {}
@@ -539,9 +539,9 @@ def #{helper_name}(*args, &block)
#{'args_for_fields_for.push(args.last)' if resource_is_plural}
opts[:class] = ResourcefulViews.resourceful_classnames('#{resource.singular}', 'update', *(opts.delete(:class) || '').split)
opts[:method] = :put
- concat(form_tag(#{resource.name_prefix}#{resource.singular}_path(*args), opts), block.binding)
+ concat(form_tag(#{resource.name_prefix}#{resource.singular}_path(*args), opts))
fields_for(*args_for_fields_for, &block)
- concat('</form>', block.binding)
+ concat('</form>')
else
opts = args.extract_options!
label = opts.delete(:label) || 'Save'

0 comments on commit d5bc420

Please sign in to comment.