some new things

This commit is contained in:
John Bintz 2013-05-08 18:44:04 -04:00
parent bc2806bfd3
commit bb4c265337
2 changed files with 10 additions and 1 deletions

View File

@ -20,6 +20,14 @@ def has_attribute?(name, value)
attribute.text == value
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 = '')
search = "[#{name}]"
if name[/\[\]$/]

View File

@ -26,8 +26,9 @@ module SemanticRailsViewHelpers
def link_to_collection(route, options = {})
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
def link_to_model(model, options = {})