allow to preselect order view

This commit is contained in:
wvengen 2014-01-17 15:03:46 +01:00
parent 1129cf4094
commit 65041c78c5
3 changed files with 12 additions and 17 deletions

View file

@ -2,7 +2,8 @@
module OrdersHelper
def update_articles_link(order, text, view, options={})
options.merge!({remote: true, id: "view_#{view}_btn"})
options = {remote: true, id: "view_#{view}_btn", class: ''}.merge(options)
options[:class] += ' active' if view.to_s == @view.to_s
link_to text, order_path(order, view: view), options
end