better labels

This commit is contained in:
John Bintz 2012-11-25 09:29:35 -05:00
parent be3127b265
commit 8a82530f96
1 changed files with 3 additions and 1 deletions

View File

@ -26,6 +26,8 @@ module SemanticRailsViewHelpers
def link_to_model_action(model, action = :show, options = {})
target_action = action
label = options.delete(:label) || t(".#{action}")
if action == :destroy
options = options.merge(:method => :delete, 'data-skip-pjax' => 'true')
action = nil
@ -36,7 +38,7 @@ module SemanticRailsViewHelpers
route = model
route = route.to_route if route.respond_to?(:to_route)
link_to t(".#{action}"), polymorphic_url(route, :action => action), options.merge("data-action" => target_action)
link_to label, polymorphic_url(route, :action => action), options.merge("data-action" => target_action)
end
def li_for(object, &block)