Skip to content

Commit

Permalink
We don't need options
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesc Esplugas committed Oct 1, 2010
1 parent 2b209e7 commit d9aad96
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/helpers/admin/sidebar_helper.rb
Expand Up @@ -22,15 +22,14 @@ def build_sidebar

def default_actions(klass)
actions = []
options = { :controller => klass.to_resource }

if @current_user.can?("create", klass)
message = _t("Add new")
actions << link_to_unless_current(message, options.merge(:action => "new"))
actions << link_to_unless_current(message, :action => "new")
end

message = _t("List")
actions << link_to_unless_current(message, options)
actions << link_to_unless_current(message, :action => "index")

return actions
end
Expand All @@ -42,10 +41,9 @@ def export(klass)
end

def custom_actions(klass)
options = { :controller => klass.to_resource }
klass.typus_actions_on(params[:action]).map do |action|
if @current_user.can?(action, klass)
(link_to_unless_current _t(action.humanize), options.merge(:action => action))
link_to_unless_current (_t(action.humanize), params.merge(:action => action))
end
end
end
Expand Down

0 comments on commit d9aad96

Please sign in to comment.