From 5bf8939a4382020823ef78d345f5cf8740ed3bd2 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sun, 9 Dec 2012 17:30:03 -0500 Subject: [PATCH] more updates --- lib/semantic_rails_view_helpers/view_helpers.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/semantic_rails_view_helpers/view_helpers.rb b/lib/semantic_rails_view_helpers/view_helpers.rb index 560e659..a15fa9b 100644 --- a/lib/semantic_rails_view_helpers/view_helpers.rb +++ b/lib/semantic_rails_view_helpers/view_helpers.rb @@ -12,13 +12,18 @@ module SemanticRailsViewHelpers end def link_to_route(route, *args) - link_to t(".#{route}"), send("#{route}_path", *args), semantic_link_data(route) + options = {} + if args.last.kind_of?(::Hash) + options = args.pop + end + + link_to t(".#{route}"), send("#{route}_path", *args), semantic_link_data(route).merge(options) end - def link_to_collection(route) + def link_to_collection(route, options = {}) collection = route.last - link_to t(".#{collection}"), polymorphic_url(route), semantic_link_data(collection) + link_to t(".#{collection}"), polymorphic_url(route), semantic_link_data(collection).merge(options) end def link_to_model(model)