lib/masterview/directives/link_to_remote.rb in masterview-0.2.5 vs lib/masterview/directives/link_to_remote.rb in masterview-0.3.0
- old
+ new
@@ -1,17 +1,22 @@
module MasterView
module Directives
#creates a link_to_remote
- class Link_to_remote < MasterView::DirectiveBase
- def stag(dcs)
- end
+ class LinkToRemote < MasterView::DirectiveBase
- def etag(dcs)
- remove_strings_from_attr_value!
- prepend_to_attr_value! quote( content_str ) #prepend quoted link name
- self.content=''
- erb_content('link_to_remote ' + attr_value)
+ metadata :priority => :default,
+ :category => 'link',
+ :description => 'Replaces the element using the Rails link_to_remote helper',
+ :element_usage => 'a'
+
+ attr_arg :name do |value, args| if value.include?('=>') : args.unshift(value); end; nil; end # if hash push back on, discard name
+ attr_arg :options, :default => {}
+ attr_arg :html_options, :default => {}, :append_element_attrs => [:common_html]
+
+ event :element do
+ render erb_content('link_to_remote', quote(content_string), :options, :html_options)
end
+
end
end
end