Merge branch 'master' of github.com:johnbintz/semantic_rails_view_helpers
This commit is contained in:
commit
1f83533d8a
|
@ -1,5 +1,18 @@
|
|||
def find_attribute(name, value = nil)
|
||||
attribute = find("[data-field='#{name}']")
|
||||
def find_attribute(name, options_or_value = nil, options = nil)
|
||||
if options
|
||||
value = options_or_value
|
||||
else
|
||||
case options_or_value
|
||||
when Hash
|
||||
options = options_or_value
|
||||
value = nil
|
||||
else
|
||||
value = options_or_value
|
||||
options = {}
|
||||
end
|
||||
end
|
||||
|
||||
attribute = find("[data-field='#{name}']", options)
|
||||
|
||||
yield attribute, @inputs[name] if block_given?
|
||||
|
||||
|
|
Loading…
Reference in New Issue