some new things
This commit is contained in:
parent
bc2806bfd3
commit
bb4c265337
|
@ -20,6 +20,14 @@ def has_attribute?(name, value)
|
||||||
attribute.text == value
|
attribute.text == value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def find_first(search)
|
||||||
|
omatch = Capybara.match
|
||||||
|
Capybara.match = :first
|
||||||
|
result = find(search)
|
||||||
|
Capybara.match = omatch
|
||||||
|
result
|
||||||
|
end
|
||||||
|
|
||||||
def find_input(name, additional_search = '', type = '')
|
def find_input(name, additional_search = '', type = '')
|
||||||
search = "[#{name}]"
|
search = "[#{name}]"
|
||||||
if name[/\[\]$/]
|
if name[/\[\]$/]
|
||||||
|
|
|
@ -26,8 +26,9 @@ module SemanticRailsViewHelpers
|
||||||
|
|
||||||
def link_to_collection(route, options = {})
|
def link_to_collection(route, options = {})
|
||||||
collection = route.last
|
collection = route.last
|
||||||
|
options[:label] ||= t(".#{collection}")
|
||||||
|
|
||||||
link_to t(".#{collection}"), polymorphic_url(route), semantic_link_data(collection).merge(options)
|
link_to options[:label], polymorphic_url(route), semantic_link_data(collection).merge(options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def link_to_model(model, options = {})
|
def link_to_model(model, options = {})
|
||||||
|
|
Loading…
Reference in New Issue